Lecture 6: Timers, Counters, PWM Flashcards
(9 cards)
Can a timer keep the time even if the processor is off?
Yes
What are the 3 sources that a clock can run off?
Quartz clock
Pre scaled clock
External clock
What is the max prescaler on Timer 0?
1023 - > 10 bit
On Timer 0, what is the direction of count?
Always up
What happens to Timer 0 when it reaches its max value?
it will overrun and then reset, starting from the bottom. We can set an overflow interrupt for code to execute when the timer reaches its max value.
With NO prescaling, what is the timeout period of Timer 0?
Range / Clock Frequency
What is the formula for 1 tick period?
1 / clock frequency
In what Register do we set the prescaler for the timers?
Timer0: TCCR0
Timer1: TCCR1B
Timer2: TCCR2
In PWM generation, what is the dutycycle formula?
Pulsewidth / period