Page 1 of 1

Comms Simulation and PIN Read on UNO

Posted: Thu Mar 25, 2021 7:25 pm
by p.erasmus
Hi All,

I just want to ask during the Comms Simulation is there another way to read a Pin which is defined in the properties of the I2C at the moment it seems it is only possible by using the SCADA macro IOGetInput() as below( I need this pin as the ADC asserts this pin when the conversion is completed and the data should be read,

P2.jpg
P2.jpg (35.59 KiB) Viewed 2493 times
In the real component(after) exposing it should read the RDY pin specified by the user as below
Or should I just use the IOGetInput() macro and as a last step replace that part with a read to the real pin in code only problem is if the user will do Comms simulation then the code will not work , may be you guys have better solution

P1.jpg
P1.jpg (49.93 KiB) Viewed 2493 times

Thanks as always appreciate your time and efforts

Re: Comms Simulation and PIN Read on UNO

Posted: Mon Mar 29, 2021 10:56 pm
by BenR
Hi Peter,

That's a tricky one, reading the pin like your doing is certainly one way.

Is there a maximum time to be ready where you could just delay for that maximum time and then be sure that the sample is done and ready to collect? Might slow things down a bit but keeps the sim simple.

Re: Comms Simulation and PIN Read on UNO

Posted: Tue Mar 30, 2021 6:52 am
by p.erasmus
Hi Ben,

Thanks ,yes it has a sample time so at 860 SPS you need with the internal 1MHZ OSC 1.2mSec +/-10% so around 2mSEC I can delay it
for testing that is ok ,reading the PIN is slower might be slower but I am not testing for real time sampling so it more getting the function correctly for the component and in the real HW it can read the PIN ,

This is working on the SCADA reading the pin as I do .
just was thinking if there is other possibilities..

Thanks again