Go Down

Topic: How fast and stable can arduno trigger digital IOs? (Read 1 time) previous topic - next topic

mortos360

Hallo,
I am very new to Arduino and to electronics in general, so before I start with the wrong path, I thought I ask here first :)

I have connect my Arduino Mega to my oscilloscope and upload a simple Blink LOOP with the delayMicroseconds() command. It seems that maximal
speed Arduino can do is 62us at an inaccuracy of +/- 300ns    (on 1 digital port, port 12 in this case)

For my project I will need stable//accurate signals in a range of 60ns - 40ms on 11ports (10 for a LED array and 1 to control another device)... is that even possible with arduinos programming environment or do I need assembler for that?

Thanks!!


robtillaart

Given the fact that Arduino runs at 16 Mhz, it is easy to see that 60ns signals is at the edge/beyond its capabilities.

Imho : for 60 ns signals you need a processor at least in the 100Mhz range, a realistic minimum is 200Mhz I guess.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

mortos360

@robtillaart
Thanks for the answer!
I can't find the post anymore, but I am sure I have read somewhere that he has a cycle of 2ns.. but I may be wrong on that since I don't understand much of the actual internal work of a MC.
Anyway... I would be happy with a stable 40ms signal.

Example: 2ms ON, 38ms OFF, LOOP...     even at that speed, he is jigling too much for my taste.
Is the delay() command the usualy way to go for that, or is there any better command for that?

The more I google, the more I get the impression that I need assembler for accurate timings for thos signals.

sixeyes

If you're looking for 2ms pulse width you may find delayMicroseconds more to your liking (http://arduino.cc/en/Reference/DelayMicroseconds) or
you may want to avoid using delay and just loop checking micros() to see if the pin needs pulsing. The other thing to be aware of is that digitalWrite() takes quite a while, if you want a faster response you may need to manipulate the port directly.

mortos360

@sixeyes
I got to try DelayMicroseconds tomorow!
"you may need to manipulate the port directly"  what you mean by that?
How do I manipulate the port directly?

Go Up