165
CHAPTER 7 16-BIT TIMER/EVENT COUNTER 4
User’s Manual U14701EJ3V0UD
Figure 7-1 shows a block diagram.
Figure 7-1. 16-Bit Timer/Event Counter 4 Block Diagram
(1) 16-bit timer counter 4 (TM4)
TM4 is a 16-bit register that counts count pulses.
The counter is incremented in synchronization with the rising edge of an input clock. TM4 cannot be read or
written to.
The value of this register is undefined when RESET is input.
The count value is reset to 0000H in the following cases.
<1>
<2>
<3>
If TCE4 is cleared
If TM4 and CR4 match with each other in clear & start mode on match between TM4 and CR4
Immediately after TM4 overflowed in free-running mode
(2) 16-bit timer compare register 4 (CR4)
This register always compares the value set in CR4 and the count value of 16-bit timer counter 4 (TM4). If the
two values match, CR4 generates an interrupt request (INTTM4). If TM4 is specified as an interval timer, this
register can be used to hold the interval time.
CR4 is set by a 16-bit memory manipulation instruction.
The value of this register is undefined when RESET is input.
Caution Do not write values to CR4 during TM4 count operation. Stop the count operation first if
overwriting the same value.
Internal bus
16-bit timer compare
register 4 (CR4)
16-bit timer
counter 4 (TM4)
TI4/P71
f
X
/2
5
f
X
/2
7
f
X
Match
Clear
Selector
OVF
2
Clear control
Internal bus
TCE4 TMM4 TMO4 LVS4 OVF4
16-bit timer mode
control register 4 (TMC4)
TCL40
TO4/P70
INTTM4
TCL41
S
S
O