[sdiy] arduino timing

Matthew Smith matt at smiffytech.com
Tue Mar 15 11:22:28 CET 2011


Quoth Chris Muir at 15/03/11 19:39...
> I agree w/ Morgan that timer interrupts are key here. The Arduino should be capable of some pretty tight timing when driven from a timer interrupt.

Seconded. Er, thirded!

If you can get away with counts of 0xFFFF or less, you can rely entirely 
on a timer. If you need longer delays and need to decrement a variable 
on every counter interrupt 1) you must declare that variable as volatile 
and 2) keep a close eye on the order in which you do things in the ISR. 
Conditional statements can take different times to execute, depending on 
the condition.

-- 
Matthew Smith
Smiffytech - Technology Consulting & Web Application Development
Business:      http://www.smiffytech.com/
Blog/personal: http://www.smiffysplace.com/
LinkedIn:      http://www.linkedin.com/in/smiffy
Skype:         msmiffy
Twitter:       @smiffy



More information about the Synth-diy mailing list