Pages: [1]   Go Down
Author Topic: What hardware timers available on the Arduino ?  (Read 476 times)
0 Members and 1 Guest are viewing this topic.
Canada
Offline Offline
Newbie
*
Karma: 1
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What hardware timer/counters are available on the Arduino (ATmega328)? Of the three, it looks like one is used for the Delay() and AnalogWrite() library routines. Milli() prob uses one? Also I'm not sure what timer interrupts exist in the stock Arduino.

Just trying to see what MCU resources I can use. I couldn't find docs about this.


Logged

Ontario
Offline Offline
God Member
*****
Karma: 20
Posts: 835
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are several useful writeups explaining the timers and useful libraries for using them:
http://www.mythic-beasts.com/~markt/ATmega-timers.html
http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM
http://www.arduino.cc/playground/Code/Timer1
http://www.arduino.cc/playground/Code/SimpleTimer

For the most part, Timer0 is the only one that has dedicated functions.  It provides the interrupt source for delay() and millis() as well as PWM timing for pins 5 and 6.  The other timers are needed only if you need to do tones or PWM output on other pins.
Logged

Pages: [1]   Go Up
Jump to: