![]() I also assumed that by running almost nothing in the while loop, the loop time will approach the CPU clock tick. Thus Arduino OS would dedicate itself solely to that program. This assumption is based on the consideration that there seemed to be no other software running on the Arduino once I downloaded my own program. I assumed that Arduino UNO would run as a near realtime OS and that it would have reliable or deterministic while loop clock intervals. ![]() NOTE: All LabVIEW VIs are in LabVIEW 2014 ![]() I thought that the loop time would also be the same. Is this correct? The documented clock speed for Arduino UNO is 16MHz. And this means 1/0.000064 loops per second or 15.625kHz. The LabVIEW VI showed that the fastest loop time that the Arduino UNO could do was 64 microseconds. On the LabVIEW side I created a LabVIEW Serial Read VI using same Baud rate of 115200. I used baud rate of 115200 and reported the time snap shot at 50msec intervals. I compiled the Arduino UNO LabVIEW VI using Arduino Compatible Compiler for LabVIEW and downloaded that to the Arduino UNO. I also added Serial Write function so that Arduino UNO could report back a snapshot of what the loop time was. To do this I created an empty while loop and I only placed the Arduino microsecond timer functions to capture the minimum loop time. This made me suspect the speed of Arduino UNO in running a loop. Eg by quickly rotating encoder by a quick hand push or strike about 10 counts were missed. The count results read from Arduino UNO were OK for slow hand speed rotation but counts were missed when rotating faster. The encoder is 32 Pulses Per Revolution and is of the optical incremental type of encoder. I was able to wire the encoder sensor and I provided external excitation of 5V to my encoder with common ground to Arduino UNO board. I am using LabVIEW with Arduino UNO board to read encoder digital signals at 5V TTL.
0 Comments
Leave a Reply. |