I'm using ATmega32. This two timers looks very similar. What is a difference between them? When should I use Timer0, and when Timer2?
-
1\$\begingroup\$ Did you read the datasheet? There's a separate chapter for each timer. \$\endgroup\$– Nick AlexeevMar 3, 2014 at 23:20
-
\$\begingroup\$ Probably one of the two can be routed to the UART peripheral. I didn't check the datasheet, but that is what I remember from a similar search a while ago. There are probably other similar differences. \$\endgroup\$– jippieMar 4, 2014 at 6:32
1 Answer
Timer2 is async timer. It means it can count when sleeping. But it's tricky to setup it when external clock is required. When external clock source is to be used a few pulses to setup it correctly is needed. I.e. it limits timer2 counter to be used as random pulse counter.