EasyManuals Logo

Atmel AVR AT90S2313 User Manual

Atmel AVR AT90S2313
91 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #35 background imageLoading...
Page #35 background image
35
AT90S2313
0839G–08/01
Timer/Counter1 Input Capture
Register – ICR1H and ICR1L
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.
The TEMP register is also used when accessing TCNT1 and OCR1A. If the main pro-
gram and interrupt routines perform access to registers using TEMP, interrupts must be
disabled during access from the main program or interrupts if interrupts are re-enabled.
Timer/Counter1 in PWM Mode When the PWM mode is selected, Timer/Counter1 and the Output Compare Register1
(OCR1A) form an 8-, 9- or 10-bit, free-running, glitch-free and phase-correct PWM with
output on the PB3(OC1) pin. Timer/Counter1 acts as an up/down counter, counting up
from $0000 to TOP (see Table 11), where it turns and counts down again to zero before
the cycle is repeated. When the counter value matches the contents of the 8, 9 or 10
least significant bits of OCR1A, the PB3(OC1) pin is set or cleared according to the set-
tings of the COM1A1 and COM1A0 bits in the Timer/Counter1 Control Register
(TCCR1). Refer to Table 12 for details.
Bit 151413121110 9 8
$25 ($45) MSB ICR1H
$24 ($44) LSB ICR1L
76543210
Read/WriteRRRRRRRR
RRRRRRRR
Initial value00000000
00000000
Table 11. Timer TOP Values and PWM Frequency
PWM Resolution Timer TOP Value Frequency
8-bit $00FF (255) f
TC1
/510
9-bit $01FF (511) f
TC1
/1022
10-bit $03FF(1023) f
TC1
/2046

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atmel AVR AT90S2313 and is the answer not in the manual?

Atmel AVR AT90S2313 Specifications

General IconGeneral
BrandAtmel
ModelAVR AT90S2313
CategoryMicrocontrollers
LanguageEnglish

Related product manuals