atmega103 ATMEL Corporation, atmega103 Datasheet - Page 40

no-image

atmega103

Manufacturer Part Number
atmega103
Description
Atmega103 8-bit With 128k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
atmega103-6AC
Manufacturer:
ATMEL
Quantity:
1
Part Number:
atmega103-6AI
Manufacturer:
ATMEL
Quantity:
586
Part Number:
atmega103-6AI
Manufacturer:
Atmel
Quantity:
10 000
40
ATmega103(L)
Figure 31. Timer/Counter2 Block Diagram
The 8-bit Timer/Counter0 can select clock source from PCK0 or prescaled PCK0. The 8-
bit Timer/Counter2 can select clock source from CK, prescaled CK or an external pin.
Both Timer/Counters can be stopped as described in the specification for the
Timer/Counter Control Registers – TCCR0 and TCCR2.
The different Status Flags (Overflow, Compare Match and Capture Event) are found in
the Timer/Counter Interrupt Flag Register (TIFR). Control signals are found in the
Timer/Counter Control Registers – TCCR0 and TCCR2. The interrupt enable/disable
settings are found in the Timer/Counter Interrupt Mask Register (TIMSK).
When Timer/Counter2 is externally clocked, the external signal is synchronized with the
Oscillator frequency of the CPU. To assure proper sampling of the external clock, the
minimum time between two external clock transitions must be at least one internal CPU
clock period. The external clock signal is sampled on the rising edge of the internal CPU
clock.
The 8-bit Timer/Counters feature a high-resolution and a high-accuracy usage with the
lower prescaling opportunities. Similarly, the high prescaling opportunities make these
units useful for lower speed functions or exact timing functions with infrequent actions.
Both Timer/Counters support two Output Compare functions using the Output Compare
Registers (OCR0 and OCR2) as the data source to be compared to the Timer/Counter
contents. The Output Compare functions include optional clearing of the counter on
compare match and action on the Output Compare pins – PB4(OC0/PWM0) and
PB7(OC2/PWM2) – on compare match.
Timer/Counters 0 and 2 can also be used as 8-bit Pulse Width Modulators. In this mode
the Timer/Counter and the Output Compare Register serve as a glitch-free, stand-alone
PWM with centered pulses. Refer to page 43 for a detailed description of this function.
7
7
7
8-BIT COMPARATOR
TIMER/COUNTER2
OUTPUT COMPARE
REGISTER2 (OCR2)
REGISTER (TIMSK)
TIMER INT. MASK
(TCNT2)
0
0
0
T/C2 OVER-
FLOW IRQ
T/C CLEAR
T/C CLK SOURCE
UP/DOWN
REGISTER (TIFR)
TIMER INT. FLAG
T/C2 COMPARE
MATCH IRQ
CONTROL
LOGIC
REGISTER (TCCR2)
T/C2 CONTROL
0945I–AVR–02/07
CK
T2

Related parts for atmega103