
262
CHAPTER 12 MULTIFUNCTIONAL TIMERS
12.1 Overview of Multifunctional Timers
The multifunctional timer unit enables 12 channels of independent waveform outputs
based on the 16-bit free-running timer, and also enables the measurements of input
pulse width and external clock periods.
s Multifunctional Timer Configuration
r 16-bit free-running timer (one channel)
The 16-bit free-running timer consists of a 16-bit up-counter (timer data register (TCDT)),
compare clear register (CPCLR), timer control status register (TCCS), and prescaler.
The counter output values of the 16-bit free-running timer are used as the base timer of the
output compare and input capture.
The following eight counter operating clocks are available to choose from:
1/
φ, 2/φ, 22/φ, 23/φ, 24/φ, 25/φ, 26/φ, 27/φ
φ: Machine clock frequency
An interrupt can be output when an overflow of the counter value of the 16-bit free-running
timer occurs, or when the counter value and the compare clear register (CPCLR) value of
the 16-bit free-running timer match (TCCS: ICRE="1", MODE="1") and then the counter
value of the 16-bit free-running timer is cleared to "0000H".
The counter value of the 16-bit free-running timer can be cleared to "0000H" when the
counter value is reset, the clear bit (SCLR) of the timer control status register (TCCS) is set
to "1", the counter value and the compare clear register (CPCLR) value of the 16-bit free-
running timer match (TCCS: MODE="1"), or the timer data register (TCDT) is set to "0000H".
r Output compare (six channels)
The output compare unit consists of compare registers (OCCP0 to OCCP5), compare control
registers (OCS0 to OCS5), and a compare output latch.
When the counter value of the 16-bit free-running timer matches that of a compare register
(OCCP0 to OCCP5) value, the output level can be inverted and, at the same time, an interrupt
can be output.
Compare registers (OCCP0 to OCCP5) can be operated independently in six channels.
Compare registers (OCCP0 to OCCP5) of each channel have a corresponding output pin
and the lower compare control registers (OCS0, OCS2, OCS4) of each channel have an
interrupt request flag.
Two channels of compare registers (OCCP0 to OCCP5) can be used to invert the pin output.
When the counter value and a compare register (OCCP0 to OCCP5) value of the 16-bit free-
running timer match (OCS0, OCS2, OCS4: IOP0="1", IOP1="1"), an interrupt can be output
(OCS0, OCS2, OCS4: IOE0="1", IOE1="1").
An initial value can be set to the pin output of each channel.