ADuCM310 Hardware Reference Manual
UG-549
Rev. C | Page 157 of 192
GENERAL-PURPOSE TIMERS
GENERAL-PURPOSE TIMERS FEATURES
The
integrates three general-purpose timers with the following features:
•
Three identical, general-purpose, 16-bit count-up/count-down timers
•
Timer 0, Timer 1, and Timer 2
•
Clocked from four different clocks
•
Peripheral clock (PCLK)
•
80 MHz system clock (HCLK)
•
32 kHz internal oscillator (LFOSC)
•
16 MHz external crystal (HFXTAL) or internal 16 MHz oscillator (HFOSC), dependent on CLKCON0[11]
•
Clock sources can be scaled down using a prescaler of 16,256, or 32,768. Additionally, two of the clocks can be scaled down using a
prescaler of 4, while the other two clock sources can be used directly (prescaler of 1).
•
Two modes
•
Free running
•
Periodic
•
Capture events feature
•
Capability to capture 15 different events on each timer
GENERAL-PURPOSE TIMERS BLOCK DIAGRAM
16-BIT LOAD
PRESCALER
1, 4, 16, 256
OR 32,768
TIMER VALUE
16-BIT UP/DOWN COUNTER
TIMER INTERRUPT
CAPTURE
EVENT SELECT
PCLK
HCLK
LFOSC
HFXTAL/HFOSC
NOTES
1. 16MHz EXTERNAL CRYSTAL (HFXTAL) OR INTERNAL 16MHz OSCILLATOR (HFOSC),
DEPENDS ON THE VALUE IN CLKCON0[11].
CLOCK SOURCES
1
1461-
025
Figure 27. General-Purpose Timers Block Diagram
GENERAL-PURPOSE TIMERS OVERVIEW
Timer 0, Timer 1, and Timer 2 are three identical, general-purpose, 16-bit count-up/count-down timers. They can be clocked from four
different clock sources:
•
PCLK
•
HCLK
•
32 kHz internal oscillator (LFOSC)
•
16 MHz external crystal (HFXTAL) or the internal 16 MHz oscillator (HFOSC); configured via CLKCON0[11]
This clock source can be scaled down using a prescaler of 1 or 4, 16,256, or 32,768.
The timers can be either free running or periodic.
•
In free running mode, the counter decrements from full scale to zero scale or increments from zero scale to full scale, and then restarts.
•
In periodic mode, the counter decrements or increments from the value in the load register (TxLD MMR, where x is 0 for Timer 0,
1 for Timer 1, and 2 for Timer 2) until zero scale or full scale is reached, and then restarts at the value stored in the load register.
The value of a counter can be read at any time by accessing its value register (TxVAL).
The TxCON register selects the timer mode, configures the clock source, selects count-up/count-down, starts the counter, and controls
the event capture function.