NEC V850E/Dx3 Preliminary User's Manual page 421

32-bit single-chip microcontroller
Table of Contents

Advertisement

16-bit Timer/Event Counter P (TMP)
Downloaded from
Elcodis.com
electronic components distributor
FFFFH
16-bit counter
0000H
TPnCE bit
TIPnm pin input
TPnCCRm register
0000H
INTTPnCCm signal
INTTPnOV signal
TPnOVF bit
Figure 11-38
Basic timing in pulse width measurement mode
When the TPnCE bit is set to 1, the 16-bit counter starts counting. When the
valid edge input to the TIPnm pin is later detected, the count value of the 16-bit
counter is stored in the TPnCCRm register, the 16-bit counter is cleared to
0000H, and a capture interrupt request signal (INTTPnCCm) is generated.
The pulse width is calculated as follows.
First pulse width = (D
Second and subsequent pulse width = (D
If the valid edge is not input to the TIPnm pin even when the 16-bit counter
counted up to FFFFH, an overflow interrupt request signal (INTTPnOV) is
generated at the next count clock, and the counter is cleared to 0000H and
continues counting. At this time, the overflow flag (TPnOPT0.TPnOVF bit) is
also set to 1. Clear the overflow flag to 0 by executing the CLR instruction via
software.
If the overflow flag is set to 1, the pulse width can be calculated as follows.
First pulse width = (D
Second pulse width and on = (10000H + D
Preliminary User's Manual U17566EE1V2UM00
D
D
0
1
+ 1) × Count clock cycle
0
) × Count clock cycle
- D
N - 1
N
+ 10001H) × Count clock cycle
0
) × Count clock cycle
- D
N - 1
N
Chapter 11
D
D
2
3
Cleared to 0 by
CLR instruction
421

Advertisement

Table of Contents
loading

Table of Contents