atmega103 ATMEL Corporation, atmega103 Datasheet - Page 53

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
Timer/Counter1 in PWM Mode
0945I–AVR–02/07
The Input Capture Register is a 16-bit read-only register.
When the rising or falling edge (according to the Input Capture edge setting (ICES1)) of
the signal at the Input Capture pin – PD4(IC1) – is detected, the current value of the
Timer/Counter1 is transferred to the Input Capture Register (ICR1). At the same time,
the Input Capture Flag (ICF1) is set (one).
Since the Input Capture Register (ICR1) is a 16-bit register, a temporary register TEMP
is used when ICR1 is read to ensure that both bytes are read simultaneously. When the
CPU reads the Low Byte ICR1L, the data is sent to the CPU and the data of the High
Byte ICR1H is placed in the TEMP Register. When the CPU reads the data in the High
Byte ICR1H, the CPU receives the data in the TEMP Register. Consequently, the Low
Byte ICR1L must be accessed first for a full 16-bit register read operation.
The TEMP Register is also used when accessing TCNT1, OCR1A and OCR1B. If the
main program and interrupt routines perform access to registers using TEMP, interrupts
must be disabled during access from the main program.
When the PWM mode is selected, Timer/Counter1, the Output Compare Register1A
(OCR1A) and the Output Compare Register1B (OCR1B) form a dual 8-, 9- or 10-bit,
free-running, glitch-free and phase-correct PWM with outputs on the PB5(OC1A) and
PB6(OC1B) pins. Timer/Counter1 acts as an up/down counter, counting up from $0000
to TOP (see Table 16), where it turns and counts down again to zero before the cycle is
repeated. When the counter value matches the contents of the 10 least significant bits of
OCR1A or OCR1B, the PB5(OC1A)/PB6(OC1B) pins are set or cleared according to the
settings of the COM1A1/COM1A0 or COM1B1/COM1B0 bits in the Timer/Counter1
Control Register, TCCR1A. Refer to Table 19 for details.
Table 18. Timer TOP Values and PWM Frequency
Table 19. Compare1 Mode Select in PWM Mode
Note:
Note that in the PWM mode, the 10 least significant OCR1A/OCR1B bits, when written,
are transferred to a temporary location. They are latched when Timer/Counter1 reaches
Read/Write
Initial Value
COM1X1
0
0
1
1
X = A or B
PWM Resolution
COM1X0
10-bit
8-bit
9-bit
R
R
0
0
0
1
0
1
Effect on OCX1
Not connected
Not connected
Cleared on compare match, up-counting. Set on compare match,
down-counting (non-inverted PWM).
Cleared on compare match, down-counting. Set on compare match,
up-counting (inverted PWM).
R
R
0
0
R
R
0
0
R
R
0
0
Timer TOP value
$03FF (1023)
$00FF (255)
$01FF (511)
R
R
0
0
R
R
0
0
ATmega103(L)
R
R
0
0
Frequency
f
f
f
TCK1
TCK1
R
R
0
0
TCK1
/1022
/2046
/510
53

Related parts for atmega103