Professional Documents
Culture Documents
1. Quick Revision
2. ATmega 32 : Timer & Counter Programming
1
2
3
TCCR: Timer/Counter Control Register
TOV: Timer Overflow
TCNT: Timer/Counter Register
OCR: Output Compare Register
OCF: Output Compare Flag
4
5
6
7
8
9
10
Question..
What would be the content of TCCR0 if you want to
run the counter in Normal mode with No
Prescaling?
11
Question..
What would be the content of TCCR0 if you want to
run the counter in CTC mode with external clock
source, clock activating on rising edge?
12
Question..
Find the timers clock frequency and its period for
various AVR-based system with the following clock
frequencies. Assume that no prescaler is used.
A. 10 MHz
B. 8 MHz
C. 1 MHz
13
Time Delay Calculations
14
Time Delay Calculations
15
Question..
What value will you load into TCNTO if you want to
generate time delay of 25 uSec ? Assume Clock
frequency = 1 MHz, and no prescaling is used.
16
Question..
What value will you load into TCNTO if you want to
generate time delay of 1 uSec ? Assume Clock
frequency = 10 MHz, and no prescaling is used.
17
Steps For Programming
18
AVR: 8-bit Timer/Counter 0
19