278
CHAPTER 12 MULTI-FUNCTION TIMER
MB90560 series
12.1 Overview of Multi-function Timer
The multi-function timer consists of a 16-bit free-run timer, six 16-bit output compare,
four 16-bit input capture, 6 channels of 8-bit PPG timer (3 channels of 16-bit PPG timer)
and a waveform generator. By using this waveform generator, 12 independent
waveform can be outputted through 16-bit free-run timer. Furthermore input pulse
width measurement and external clock cycle measurement can be done.
16-bit free-run timer (X1)
The 16-bit free-run timer consists of a 16-bit up-counter, control register, 16-bit compare clear
register and a prescaler. The output value of this counter will be used as the count clock of the
output compares and input captures
6 types of counter operation clock (
φ
,
φ
/2,
φ
/4,
φ
/8,
φ
/16,
φ
/32,
φ
/64
φ
/128) can be selected.
φ
: Internal clock
An interrupt is generated when there is an overflow in the counter value or comparing match
with compare clear register (Mode setting is necessary for compare match)
Reset, software clear, compare match with compare clear register will reset the counter value
to “0000
H
”
I
Output compare (X6)
The output compare consists of six 16-bit compare registers, compare output latch and compare
control registers. An interrupt is generated and output level is inverted when the value of 16-bit
free run timer and compare register are matched.
6 compare registers can be operated independently.
Output pins and interrupt flag are corresponding to each compare register.
2 compare register can be paired to control the output pins.
Inverts output pins by using 2 compare register together.
Setting the initial value for each output pin is possible.
An interrupt is generated when compare register is matched.
I
Input capture (x4)
Input capture consists of 4 independent external input pins, the corresponding capture register
and capture control register. By detecting any edge of the input signal from the external pin, the
value of the 16-bit free-run timer can be stored in the capture register and an interrupt is
generated simultaneously.
3 types of trigger edge (rising edge, falling edge, both edge) of the external input signal can
be selected.
4 input captures can operated independently.
An interrupt is generated by detecting a valid edge from external input.