Pulse Width Measurement Operations - NEC 78K0S/KA1+ Preliminary User's Manual

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

Advertisement

www.DataSheet4U.com
6.4.3

Pulse width measurement operations

It is possible to measure the pulse width of the signals input to the TI000 pin and TI010 pin using 16-bit timer
counter 00 (TM00).
There are two measurement methods: measuring with TM00 used in free-running mode, and measuring by
restarting the timer in synchronization with the edge of the signal input to the TI000 pin.
When an interrupt occurs, read the valid value of the capture register, check the overflow flag, and then calculate
the necessary pulse width. Clear the overflow flag after checking it.
The capture operation is not performed until the signal pulse width is sampled in the count clock cycle selected by
prescaler mode register 00 (PRM00) and the valid level of the TI000 or TI010 pin is detected twice, thus eliminating
noise with a short pulse width.
www.DataSheet4U.com
Rising edge detection
Setting
The basic operation setting procedure is as follows.
<1> Set the CRC00 register (see Figures 6-18, 6-21, 6-23, and 6-25 for the set value).
<2> Set the count clock by using the PRM00 register.
<3> Set the TMC00 register to start the operation (see Figures 6-18, 6-21, 6-23, and 6-25 for the set value).
Caution To use two capture registers, set the TI000 and TI010 pins.
Remarks 1. For the setting of the TI000 (or TI010) pin, see 6.3 (5) Port mode register 3 (PM3).
2. For how to enable the INTTM000 (or INTTM010) interrupt, see CHAPTER 12
96
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Figure 6-17. CR010 Capture Operation with Rising Edge Specified
Count clock
N − 3
TM00
TI000
CR010
INTTM010
FUNCTIONS.
Preliminary User's Manual U16898EJ1V0UD
N − 2
N − 1
N
N + 1
N
INTERRUPT

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mpd78f9221Mpd78f9222

Table of Contents