ATMEGA128-16AU SL383 Atmel, ATMEGA128-16AU SL383 Datasheet - Page 110

no-image

ATMEGA128-16AU SL383

Manufacturer Part Number
ATMEGA128-16AU SL383
Description
Manufacturer
Atmel
Datasheet
Timer/Counter Prescaler
Special Function IO Register –
SFIOR
110
ATmega128
Figure 45. Prescaler for Timer/Counter0
The clock source for Timer/Counter0 is named clk
main system clock clk
nously clocked from the TOSC1 pin. This enables use of Timer/Counter0 as a Real
Time Counter (RTC). When AS0 is set, pins TOSC1 and TOSC2 are disconnected from
Port C. A crystal can then be connected between the TOSC1 and TOSC2 pins to serve
as an independent clock source for Timer/Counter0. The Oscillator is optimized for use
with a 32.768 kHz crystal. Applying an external clock source to TOSC1 is not
recommended.
For Timer/Counter0, the possible prescaled selections are: clk
clk
selected. Setting the PSR0 bit in SFIOR resets the prescaler. This allows the user to
operate with a predictable prescaler.
• Bit 7 – TSM: Timer/Counter Synchronization Mode
Writing the TSM bit to one activates the Timer/Counter Synchronization mode. In this
mode, the value that is written to the PSR0 and PSR321 bits is kept, hence keeping the
corresponding prescaler reset signals asserted. This ensures that the corresponding
Timer/Counters are halted and can be configured to the same value without the risk of
one of them advancing during configuration. When the TSM bit is written to zero, the
PSR0 and PSR321 bits are cleared by hardware, and the Timer/Counters start counting
simultaneously.
TOSC1
Bit
Read/Write
Initial Value
clk
PSR0
CS00
CS01
CS02
T0S
AS0
I/O
/128, clk
TSM
R/W
T0S
7
0
/256, and clk
I/O
clk
R
6
0
. By setting the AS0 bit in ASSR, Timer/Counter0 is asynchro-
T0S
T0S
R
5
0
Clear
/1024. Additionally, clk
TIMER/COUNTER0 CLOCK SOURCE
R
4
0
0
ACME
R/W
10-BIT T/C PRESCALER
T0
3
0
. clk
clk
T0
T0
T0S
PUD
R/W
is by default connected to the
2
0
as well as 0 (stop) may be
T0S
PSR0
/8, clk
R/W
1
0
T0S
PSR321
R/W
/32, clk
2467S–AVR–07/09
0
0
T0S
SFIOR
/64,

Related parts for ATMEGA128-16AU SL383