CHAPTER 6 16-BIT TIMER 20
User’s Manual U15331EJ4V1UD
117
6.4.4 16-bit timer counter 20 readout
The count value of 16-bit timer counter 20 (TM20) is read out using a 16-bit manipulation instruction.
TM20 readout is performed via the counter read buffer. The counter read buffer latches the TM20 count value, the
buffer operation is held pending at the CPU clock falling edge after the read signal of the TM20 lower byte rises, and
the count value is retained. The retained counter read buffer value can be read out as the count value.
Cancellation of the pending state is performed at the CPU clock falling edge after the read signal of the TM20
higher byte falls.
RESET input sets TM20 to 0000H and TM20 starts free running.
Figure 6-10 shows the timing of 16-bit timer counter 20 readout.
Cautions 1. The count value after releasing stop becomes undefined because the count operation is
executed during the oscillation stabilization time.
2. Though TM20 is designed for a 16-bit transfer instruction, an 8-bit transfer instruction can
also be used.
When using an 8-bit transfer instruction, execute it by direct addressing.
3. When using an 8-bit transfer instruction, execute in the order from lower byte to higher byte
in pairs. If only the lower byte is read, the pending state of the counter read buffer is not
canceled, and if only the higher byte is read, an undefined count value is read.
Figure 6-10. 16-Bit Timer Counter 20 Readout Timing
CPU clock
Count clock
TM20
Count read buffer
TM20 read signal
0000H
0000H
0001H
0001H
N
N
N + 1
Read signal latch
prohibited period
Remark
N = 0000H to FFFFH