Page 1 of 3
UNO-SCADA
Posted: Tue Jun 29, 2021 8:18 am
by p.erasmus
Hi Team.
I need help to understand and work with the new SCADA API,
I have made a simple FC Chart using PIC16F1938 and transmit a SPI Transaction it woking as I would it should .

- SPI_16F.jpg (67.81 KiB) Viewed 6998 times
As you see here I have a decent Clock DATA and a CS line that is working ,the decoder can decode this and it decode the 2 bytes as 0xB7 and 0xBB
exactly as the code is written to output.
Using the exact same Chart with UNO scada the only signal/trace that is some how correct is the ( SCK) clock (yellow trace)
the MOSI(DATA)blue trace has no output and the CS(purple trace) is doing somewthing very strange far from a CS signal.
I am attching the FC chart if you can please show me what I am doing wrong in the new SCADA API I will be very happy as it has stopped to work with me .

- SPI_UNO.jpg (76.38 KiB) Viewed 6998 times
Appreciate your help I am missing something in the new API the reason things are not working
Re: UNO-SCADA
Posted: Tue Jun 29, 2021 9:46 am
by medelec35
Hi, Peter
API works by sending commands via UART (with the exception of ESP32 and Raspberry Pi).
The UART RX commands tell the target device which peripheral to run.
There is firmware that will need to be loaded onto the target device in order to run all the commands.
In the case of the UNO you can find it
here
If you download the
Arduino Uno App Developer Firmware, the zip file contains the component source and the firmware source so you can see how it works.
Within that link, there are also some simple demos.
One of the demos is for SPI slave.
That should help you get going.
You can of course create your own API if you don't want you to use the supplied one, I did that with an ESP32 Mains power monitor
Re: UNO-SCADA
Posted: Tue Jun 29, 2021 9:56 am
by p.erasmus
Thanks Martin.
What happend to the simple injector that we used to use for SCADA simulation?
No information as usual we must just know how to use new things it is getting anoying working with V9
There is a huge confusion lately we use to have injectors for SPI and I2C Hardware simulation now APP developer is somehow in the mix
(nobody isy commenting this to the users) and now you are telling me I must make my own API ,Why should I then use FC for fast simple HW simulation and coms development it worked well before !!
before I could use a injector run FC Sim and I could talk to my HW no all of a sudden it all UART based if I understand YOU CORRECTLY
5 weeks ago when I posted my I2C stopped working nobody mentioned this Ben only replied I must reflash with the new API Hex fiile
this seems to more that just the hex file that needs to be replace
I think the APP developer is only Fu*3K everything up, I am finish with this SCADA HW simulation as
Re: UNO-SCADA
Posted: Tue Jun 29, 2021 10:03 am
by BenR
Hello Peter,
The bouncing of the CS pin means the pin is probably floating and isn't being driven. The CS pin is assigned via the SPI component simulation properties. If the setting is not there then please can you post your program and I'll investigate for you.

- Props.jpg (10.4 KiB) Viewed 6972 times
Re: UNO-SCADA
Posted: Tue Jun 29, 2021 10:12 am
by p.erasmus
Re: UNO-SCADA
Posted: Tue Jun 29, 2021 10:20 am
by BenR
Sorry didn't spot the file link at the bottom.
I've just found a problem with SPI Master which has now been solved and here is an example using that.
I guess you are wanting the CS pin to be on the API Slave Pin 10, currently it is being assigned to pin 0 as your calling the CAL SPI component in your program.
Re: UNO-SCADA
Posted: Tue Jun 29, 2021 10:27 am
by p.erasmus
Ben
Thanks setting the pin in simulation does solve the floating issue
but CS is NOT working and I have NO MOSI signal
I am confused now withe the UART mix Martin is talking about

- P1.jpg (19.78 KiB) Viewed 6965 times

- DS1Z_QuickPrint1.png (44.48 KiB) Viewed 6965 times
Re: UNO-SCADA
Posted: Tue Jun 29, 2021 10:28 am
by p.erasmus
Ben
I am sorry I am a bit frustrated battling now for some time with this
Thanks I will look

Re: UNO-SCADA
Posted: Tue Jun 29, 2021 10:30 am
by BenR
Ok sorry about this Peter,
I'll have another look today and do some testing and make sure we are all on the same page.
I'll get back to you ASAP with some news.
Re: UNO-SCADA
Posted: Tue Jun 29, 2021 10:44 am
by p.erasmus
Hi Ben
Your example has no CS pin activity and no MOSI signal.
I do not know what is missing all I know the SPI and I2C with the old injectors worked perfect

I knew which components to link to which ones to have a working system,but now I have no Idea what to use and what to expect
The HW simulation is one of the greatest things in Fc for me I appreciate all efforts Ben

- DS1Z_QuickPrint1.png (43.51 KiB) Viewed 6961 times