Pulse Width Measurement Mode - Renesas M16C FAMILY Hardware Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C FAMILY:
Table of Contents

Advertisement

Under development
Preliminary specification
Specifications in this manual are tentative and subject to change.
R8C/11 Group

12.1.4 Pulse Width Measurement Mode

In this mode, the timer measures the pulse width of an external signal fed to INT1/CNTR0 pin (See
"Table 12.5 Pulse Width Measurement Mode Specifications"). Figure 12.7 shows the TXMR register
in pulse width measurement mode. Figure 12.8 shows an operation example in pulse width measure-
ment mode.
Table 12.5 Pulse Width Measurement Mode Specifications
Item
Count source
Count operation
Count start condition
Count stop condition
Interrupt request
generation timing
INT1/CNTR
pin function
0
CNTR
pin function
0
Read from timer
Write to timer
Select function
Timer X mode register
b7 b6 b5 b4 b3 b2 b1 b0
0 0
0
0
1
Notes:
1. IThe IR bit in the INT1IC register may be set to "1" (interrupt requested) when the R0EDG bit is rewritten.
Refer to the paragraph 19.2.5 "Changing Interrupt Source" in the Usage Notes Reference Book.
Figure 12.7 TXMR Register in Pulse Width Measurement Mode
Rev.0.91
2003 Sep 08
f
, f
, f
, f
1
2
8
32
• Down-count
• Continuously counts the selected signal only when the measurement pulse is "H" level,
or conversely only "L" level.
• When the timer underflows, it reloads the reload register contents before continuing
counting
Write "1" (count start) to TXS bit in TXMR register
Write "0" (count stop) to TXS bit in TXMR register
• When Timer X underflows [Timer X interruption]
• Rising or falling of CNTR0 input (end of measurement period) [INT1 interrupt]
Measurement pulse input
Programmable I/O port
Count value can be read by reading TX register
Same applies to PREX register.
Value written to TX register is written to both reload register and counter.
Same applies to PREX register.
_____
• INT1/CNTR
polarity switching function
0
Active edge of count source can be selected with R0EDG.
Symbol
TXMR
1
Bit symbol
Bit name
Operation mode
TXMOD0
select bit 0, 1
TXMOD1
INT1/CNTR
R0EDG
switching bit
Timer X count
TXS
start flag
TXOCNT
Must set to "0" in pulse width measurement mode
TXMOD2
Must set to "0" in pulse width measurement mode
TXEDG
Must set to "0" in pulse width measurement mode
TXUND
Must set to "0" in pulse width measurement mode
page 76 of 184
Specification
Address
After reset
008B
00
16
16
Function
b1 b0
1 1 : Pulse width measurement mode
polarity
0
0 : Measures "H" level width
1
1 : Measures "L" level width
0 : Stops counting
1 : Starts counting
12.1 Timer (Timer X)
RW
RW
RW
RW
RW
RW
RW
RW
RW

Advertisement

Table of Contents
loading

This manual is also suitable for:

R8c seriesTiny series

Table of Contents