2.4 Multi-Function Timer
91
2.4.5 Operating Description
(1) Timer/Waveform Generator
This block is capable of generating waveforms for four channels, and can be broadly classified in terms
of the following circuit types.
14-Bit Timer
Compare-clear register:
Sets upper limit for timer count
Prescaler:
Generates timer count clock signal
Count control unit:
Up/down selection, compare-clear function, etc.
Zero-detect circuit:
Detects zero (0000H) condition in timer
Pin Control Block (4 channels)
Zero-detect pin control unit:
Sets/resets pins according to timer zero-detect signal
Output compare register
and compare detect pin control block:
Compares output with detect register for pin control, also
performs setting, resetting and buffer transfer.
Port data register and buffer:
Register and buffer, also used as a port
Interrupt Control Block:
Outputs zero-detect, compare-detect and other interrupts
Buffer Transfer Control Block:
transfer control for all buffers
a) 14-Bit Timer
(1) Timer Start/Stop Control
When the TMST bit in the TMCR register is set to ‘1’ the timer is placed in operating state.
At this point the prescaler, used to generate the internal clock signal, is initialized and the timer
begins counting from its stop-mode value.
When the TMST bit is set to ‘0’ the timer is placed in stop state.
Following a reset the timer is initialized to 0000H, and placed in stop state.
(2) Overflow
An overflow occurs when the timer in up-count mode changes from 3FFFH to 0000H. The timer
count continues to increase from 0000H.
When the compare-clear register has any value other than 0000H (and match-detect operation is
in effect for the compare-clear register), no overflow will occur because the count is cleared or
the counting direction is reversed.
(3) Timer Count Clock (Prescaler)
The timer count clock signal is selected using the TCS1, TCS0 bits in the TMCR register.
The prescaler output for count clock signal may be selected from 1, 2, 8 or 16 machine cycles.
The prescaler is initialized when the timer is started, or cleared by a trigger signal.