![Atmel AT90S8414 Скачать руководство пользователя страница 42](http://html1.mh-extra.com/html/atmel/at90s8414/at90s8414_manual_3003427042.webp)
4-42
AT90S8414
Preliminary
THE TIMER/COUNTER1 INPUT CAPTURE REGISTER - ICR1H AND ICR1L
Bit
15
14
13
12
11
10
9
8
$25
MSB
ICR1H
$24
LSB
ICR1L
7
6
5
4
3
2
1
0
Read/Write
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
Initial value
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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
- ICP - 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.
TIMER/COUNTER1 IN PWM MODE
When the PWM mode is selected, Timer/Counter1 and the Output Compare Register1A - OCR1A and the Output
Compare Register1B - OCR1B, form a dual 10-bit, free-running, glitch-free and phase correct PWM with outputs on the
PD5(OC1A) and OC1B pins. Timer/Counter1 acts as an up/down counter, counting up from $0000 to $03FF (i.e. from 0
to 1023), when 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 PD5(OC1A)/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 10 for details.
Table 10: Compare1 Mode Select in PWM Mode
COM1X1
COM1X0
Effect on OCX1
0
0
Not connected
0
1
Not connected
1
0
Cleared on compare match, upcounting. Set on compare match, downcounting (non-
inverted PWM).
1
1
Cleared on compare match, downcounting. Set on compare match, upcounting (inverted
PWM).
Note:
X = A or B
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 the top - $03FF. This prevents the occurrence of odd-length
PWM pulses (glitches) in the event of an unsynchronized OCR1A/OCR1B write. See Figure 36 for an example.
Содержание AT90S8414
Страница 4: ...4 4 AT90S8414 Preliminary...
Страница 6: ...4 6 AT90S8414 Preliminary Block Diagram Figure 1 The AT90S8414 Block Diagram...
Страница 65: ...AT90S8414 Preliminary 4 65 Figure 50 PORTB Schematic Diagram Pin PB5 Figure 51 PORTB Schematic Diagram Pin PB6...
Страница 68: ...4 68 AT90S8414 Preliminary Figure 53 PORTC Schematic Diagram Pins PC0 PC7...
Страница 87: ...AT90S8414 Preliminary 4 87...