8-Bit Timer/Counter0 With Pwm And Asynchronous Operation; Overview - Atmel ATmega128 Manual

8-bit avr microcontroller with 128k bytes in-system programmable flash
Hide thumbs Also See for ATmega128:
Table of Contents

Advertisement

8-bit
Timer/Counter0
with PWM and
Asynchronous
Operation

Overview

Registers
2467S–AVR–07/09
Timer/Counter0 is a general purpose, single channel, 8-bit Timer/Counter module. The main
features are:
Single Channel Counter
Clear Timer on Compare Match (Auto Reload)
Glitch-free, Phase Correct Pulse Width Modulator (PWM)
Frequency Generator
10-bit Clock Prescaler
Overflow and Compare Match Interrupt Sources (TOV0 and OCF0)
Allows Clocking from External 32 kHz Watch Crystal Independent of the I/O Clock
A simplified block diagram of the 8-bit Timer/Counter is shown in
ment of I/O pins, refer to
I/O bits and I/O pins, are shown in bold. The device-specific I/O register and bit locations are
listed in the
"8-bit Timer/Counter Register Description" on page
Figure 34. 8-bit Timer/Counter Block Diagram
Timer/Counter
TCNTn
=
OCRn
Status flags
The Timer/Counter (TCNT0) and Output Compare Register (OCR0) are 8-bit registers. Interrupt
request (shorten as Int.Req.) signals are all visible in the Timer Interrupt Flag Register (TIFR).
All interrupts are individually masked with the Timer Interrupt Mask Register (TIMSK). TIFR and
TIMSK are not shown in the figure since these registers are shared by other timer units.
The Timer/Counter can be clocked internally, via the prescaler, or asynchronously clocked from
the TOSC1/2 pins, as detailed later in this section. The asynchronous operation is controlled by
the Asynchronous Status Register (ASSR). The Clock Select logic block controls which clock
source the Timer/Counter uses to increment (or decrement) its value. The Timer/Counter is inac-
"Pin Configurations" on page
TCCRn
count
clear
Control Logic
direction
BOTTOM
TOP
= 0
=
0xFF
Synchronized Status flags
ASSRn
asynchronous mode
select (ASn)
ATmega128
Figure
34. For the actual place-
2. CPU accessible I/O registers, including
104.
clk
Tn
T/C
Oscillator
Prescaler
OCn
(Int.Req.)
Waveform
Generation
Synchronization Unit
TOVn
(Int.Req.)
TOSC1
TOSC2
clk
I/O
OCn
clk
I/O
clk
ASY
93

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ATmega128 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Atmega128l

Table of Contents

Save PDF