Pulse Width Measurement - NEC Renesas V850/SC1 User Manual

32-bit single-chip microcontrollers
Hide thumbs Also See for Renesas V850/SC1:
Table of Contents

Advertisement

8.2.3 Pulse width measurement

16-bit timer register n (TMn) can be used to measure the pulse widths of the signals input to the TIn0 and TIn1
pins.
Measurement can be carried out with TMn used as a free-running counter or by restarting the timer in
synchronization with the edge of the signal input to the TIn0 pin.
(1) Pulse width measurement with free-running counter and one capture register
If the edge specified by prescaler mode register n0 (PRMn0) is input to the TIn0 pin when 16-bit timer register n
(TMn) is used as a free-running counter (refer to Figure 8-8), the value of TMn is loaded to 16-bit
capture/compare register n1 (CRn1), and an external interrupt request signal (INTTMn1) is set.
The edge is specified using bits 6 and 7 (ESn10 and ESn11) of prescaler mode register n0 (PRMn0). The rising,
falling, or both rising and falling edges can be selected.
The valid edge is detected through sampling at a count clock cycle selected by prescaler mode registers n0 and
n1 (PRMn0, PRMn1), and the capture operation is not performed until the valid level is detected two times,
eliminating noise with a short pulse width.
Figure 8-8. Control Register Settings for Pulse Width Measurement with
(a) 16-bit timer mode control registers 0, 1, 7 to 12 (TMC0, TMC1, TMC7 to TMC12)
TMCn
0
0
(b) Capture/compare control registers 0, 1, 7 to 12 (CRC0, CRC1, CRC7 to CRC12)
CRCn
0
0
Remarks 1. 0/1: When these bits are reset to 0 or set to 1, other functions can be used along with the pulse
width measurement function.
registers 0, 1, 7 to 12 (TMC0, TMC1, TMC7 to TMC12) and (2) Capture/compare control
registers 0, 1, 7 to 12 (CRC0, CRC1, CRC7 to CRC12).
2. n = 0, 1, 7 to 12
276
CHAPTER 8
TIMER/COUNTER FUNCTION
Free-Running Counter and One Capture Register
TMCn3
0
0
0
0
0
0
For details, refer to 8.1.4 (1) 16-bit timer mode control
User's Manual U15109EJ3V0UD
TMCn2
TMCn1
OVFn
1
0/1
0
CRCn2
CRCn1
CRCn0
1
0/1
0
Free-running mode
CRn0 as compare
register
CRn1 as capture
register

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents