UNO-SCADA

For general Flowcode discussion that does not belong in the other sections.
medelec35
Matrix Staff
Posts: 1994
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 630 times
Been thanked: 666 times

Re: UNO-SCADA

Post by medelec35 »

Hi Peter,
When I replied, I looked at your flowchart and to me, it looks like you are not using the firmware correctly.
That's why I mentioned how it works with the UART.
That was for information only and you don't need to know that to get it all to work as it's all done behind the scenes.
Perhaps while waiting for Ben, you could load the firmware from the link, into the Ardunio (no need for any modifications), and load the SPI Demo your PC.
See how that works as it's easy to use.
The demo (fcsx type file which is App Developer) runs in simulation mode, which will directly communicate with the Ardunio, controlling the SPI function.
all you do is stop the simulation make changes to the demo file then run the simulation again.
You don't need to create your own firmware to get it to work, I was stating the option was there if the commands required are not available for example.

Hopefully, I have not got the wrong end of the stick?
If I have, I apologise.
Martin

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Hi Martin,

Thank you for all your valuable input ,I appreciate it :D
It could well be me having the cat by the tail and this is an effort to sort this out as I have been asking for some time now about this new API
the old one is History but worked :D
When I replied, I looked at your flowchart and to me, it looks like you are not using the firmware correctly.
The old injector I new exactly how to use ,This could be the problem and I am trying to find out what I am doing wrong :D


I need this SPI /I2C HW simulation I use it all day every day and it stopped around 5 weeks ago after the fisrt update

I am sorry if I souded rude was never the intension !!!
Regards Peter - QME Electronics

medelec35
Matrix Staff
Posts: 1994
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 630 times
Been thanked: 666 times

Re: UNO-SCADA

Post by medelec35 »

Hi, peter, not a problem.
p.erasmus wrote:
Tue Jun 29, 2021 10:58 am
Hi Martin,
I need this SPi /I2C HW simulation
APP Developer will do exactly that!
Have you read the App Developer guide which can be found here.
It will take you through using App developer step by step.
It is intended for complete beginners to Flwoocde so there will be lots of information you know, but maybe worth a read?
Martin

BenR
Matrix Staff
Posts: 1940
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 506 times
Been thanked: 689 times

Re: UNO-SCADA

Post by BenR »

Hello,

The CS pin for me is working fine with the API CS Pin property of the cal_spi1 component set to 10 to generate the CS signal on pin 10.

The MOSI problem appears to be something to do with complications surrounding drawing the traces on the data recorder window. If you set the Scope Traces property to no then the MOSI signal works correctly and the SPI packets are sent together correctly in a single transaction.

SPI_Scope.jpg
SPI_Scope.jpg (45.23 KiB) Viewed 7104 times

I'm investigating now why the MOSI data is not there when Scope Traces is set to Yes.

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Ben

Can you please upload the project after you are happy that all is working,

I would like to use it as a starting point

Thank you
Regards Peter - QME Electronics

BenR
Matrix Staff
Posts: 1940
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 506 times
Been thanked: 689 times

Re: UNO-SCADA

Post by BenR »

Hello,

Right I've found a bug in the SPI code on the Arduino firmware and this has now been fixed with the latest file here.
https://www.flowcode.co.uk/wiki/index.p ... _component

Here is your project file with Scope Traces set to no, this will work with either the current firmware or the new firmware. If you set Scope Traces to yes then this will only work with the new firmware.

AD9833_Scada.fcfx
(20.83 KiB) Downloaded 570 times

Hopefully this fixes the SPI problem. did you say you're having a problem with I2C too?

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Hi Ben.

Thank you very much,I will give it a go
:D

Yes I have problems with the I2C as well and Martin (mnf) also has an issue with the Digital pins ,
I left the I2C as I completed my work with a PIC and Ghost.

I will soon start with a I2C project again and then may be we can look into it or if you have a small moment you could just check it

I appreciate your help and sorry about me letting off some steam, it was never meant in a bad way please except my appologies :D
Regards Peter - QME Electronics

BenR
Matrix Staff
Posts: 1940
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 506 times
Been thanked: 689 times

Re: UNO-SCADA

Post by BenR »

I've also now found and fixed a problem with I2C, interestingly this one was ok with Scope traces set to Yes but has the issue when set to no.

Anyway this was a component bug so the API Slave components have now all been updated.

I've not seen any issues with the digital pins yet but if you are aware of an example of them not working then I would be very willing to try and get this sorted for you too.

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Thank you very much Ben,much appreciated I will ask Martin again what was his specific issue,
may be he can post it if it still exists :D
Regards Peter - QME Electronics

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Ben.

Thank you for your efforts the SPI is working again as it was working with the old injector,

I have one/two questions question though.
The Coms Template is still based on the byte transactions and some time ago we dicussed that it is bettre to use the Transaction mode as the code will also work on ESP32 and STM devices and the byte versions does not work on ESP-STM32
will you guys update the templates or should I just change it as I have been doing :D

In the past we used the SPI or I2C cal component then the injector and the UNO_Scada
now we have the cal component or the SPI/I2C Mater component connecting directly to the UNO:_Scada I am lost as wat is the function of the DataTransfer Components ??
P2.jpg
P2.jpg (10.74 KiB) Viewed 7073 times
P1.jpg
P1.jpg (14.87 KiB) Viewed 7073 times
Regards
Regards Peter - QME Electronics

Post Reply