Qdatasheet_Logo
Integrated circuits, Transistor, Semiconductors Search and Datasheet PDF Download Site

ATMEGA161-8PC View Datasheet(PDF) - Atmel Corporation

Part Name
Description
MFG CO.
'ATMEGA161-8PC' PDF : 159 Pages View PDF
Figure 31. Timer/Counter2 Prescaler
CK
TOSC1
PCK2
Clear
AS2
10-BIT T/C PRESCALER
PSR2
0
CS20
CS21
CS22
TIMER/COUNTER2 CLOCK SOURCE
TCK2
The clock source for Timer/Counter2 prescaler is named PCK2. PCK2 is by default connected to the main system clock
CK. By setting the AS2 bit in ASSR, Timer/Counter2 is asynchronously clocked from the PD4(TOSC1) pin. This enables
use of Timer/Counter2 as a Real Time Clock (RTC). When AS2 is set, pins PD4(TOSC1) and PD5(TOSC2) are discon-
nected from Port D. A crystal can then be connected between the PD4(TOSC1) and PD5(TOSC2) pins to serve as an
independent clock source for Timer/Counter2. The oscillator is optimized for use with a 32.768 kHz crystal. Alternatively, an
external clock signal can be applied to PD4(TOSC1). The frequency of this clock must be lower than one fourth of the CPU
clock and not higher than 256 kHz. Setting the PSR2 bit in SFIOR resets the prescaler. This allows the user to operate with
a predictable prescaler.
Special Function IO Register SFIOR
Bit
7
6
5
4
3
2
1
0
$30 ($50)
-
-
-
-
-
-
PSR2 PSR10 SFIOR
Read/Write
R
R
R
R
R
R
R/W
R/W
Initial value
0
0
0
0
0
0
0
0
Bit 7..2 - Res: Reserved Bits
These bits are reserved bits in the ATmega161 and always read as zero.
Bit 1 - PSR2: Prescaler Reset Timer/Counter2
When this bit is set (one) the Timer/Counter2 prescaler will be reset. The bit will be cleared by hardware after the operation
is performed. Writing a zero to this bit will have no effect. This bit will always be read as zero if Timer/Counter2 is clocked
by the internal CPU clock. If this bit is written when Timer/Counter2 is operating in asynchronous mode however, the bit will
remain as one until the prescaler has been reset. See Asynchronous Operation of Timer/Counter2on page 43 for a
detailed description of asynchronous operation.
Bit 0 - PSR10: Prescaler Reset Timer/Counter1 and Timer/Counter0
When this bit is set (one) the Timer/Counter1 and Timer/Counter0 prescaler will be reset. The bit will be cleared by hard-
ware after the operation is performed. Writing a zero to this bit will have no effect. Note that Timer/Counter1 and
Timer/Counter0 share the same prescaler and a reset of this prescaler will affect both timers. This bit will always be read as
zero.
36
ATmega161(L)
Share Link: GO URL

All Rights Reserved © qdatasheet.com  [ Privacy Policy ] [ Contact Us ]