External Event Counter Operation - NEC 78K0S/KB1+ User Manual

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0S/KB1+:
Table of Contents

Advertisement

Count clock
TM00 count value
0000H
Timer operation enabled
CR000
INTTM000
Remark Interval time = (N + 1) × t
N = 0001H to FFFFH (settable range)
When the compare register is changed during timer count operation, if the value after 16-bit timer capture/compare
register 000 (CR000) is changed is smaller than that of 16-bit timer counter 00 (TM00), TM00 continues counting,
overflows and then restarts counting from 0. Thus, if the value (M) after the CR000 change is smaller than that (N)
before the change, it is necessary to restart the timer after changing CR000.
Figure 6-13. Timing After Change of Compare Register During Timer Count Operation (N → M: N > M)
Count clock
CR000
TM00 count value
Remark N > X > M
6.4.2

External event counter operation

Setting
The basic operation setting procedure is as follows.
<1> Set the CRC00 register (see Figure 6-14 for the set value).
<2> Set the count clock by using the PRM00 register.
<3> Set any value to the CR000 register (0000H cannot be set).
<4> Set the TMC00 register to start the operation (see Figure 6-14 for the set value).
Remarks 1. For the setting of the TI000 pin, see 6.3 (5) Port mode register 3 (PM3).
2. For how to enable the INTTM000 interrupt, see CHAPTER 13 INTERRUPT FUNCTIONS.
98
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Figure 6-12. Timing of Interval Timer Operation
t
0001H
N
0000H 0001H
Clear
N
Interrupt request generated
N
X – 1
X
User's Manual U17446EJ3V1UD
N
Clear
N
N
Interrupt request generated
M
FFFFH
0000H
0000H 0001H
N
N
0001H
0002H

Advertisement

Table of Contents
loading

Table of Contents