Pulse Period 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.5 Pulse Period Measurement Mode

In this mode, the timer measures the pulse period of an external signal fed to INT1/CNTR0 pin (See
"Table 12.6 Pulse Period Measurement Mode Specifications"). Figure 12.9 shows the TXMR register
in pulse period measurement mode. Figure 12.10 shows an operation example in pulse period mea-
surement mode.
Table 12.6 Pulse Period 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
Note: The period of input pulse must be longer than twice the period of prescaler X. Longer pulse for H width and L width
than the prescaler X period must be input. If shorter pulse than the period is input to the CNTR0 pin, the input may
be disabled.
Timer X mode register
b7 b6 b5 b4 b3 b2 b1 b0
1
0
Notes:
1. The 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.
2. TXEDG and TXUND bits are set to "0" by writing a "0" in a program. (Writing a "1" has no effect.)
Figure 12.9 TXMR Register in Pulse Period Measurement Mode
Rev.0.91
2003 Sep 08
f
, f
, f
, f
1
2
8
32
• Down-count
• After an active edge of measurement pulse is input, contents in the read-out buffer is
retained in the first underflow of prescaler X. Then the timer X reloads contents in the
reload register in the second underflow of prescaler X and continues 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 or reloads [Timer X interrupt]
• Rising or falling of CNTR0 input (end of measurement period) [INT1 interrupt]
Measurement pulse input
Programmable I/O port
Contents in the read-out buffer can be read by reading TX register. The value retained in
the read-out buffer is released by reading TX register.
Value written to TX register is written to both reload register and counter.
Same applies to PREX register.
_____
• INT1/CNTR0 polarity switching function
Measurement period of input pulse can be selected with R0EDG bit.
Symbol
TXMR
0 0
Bit symbol
Bit name
TXMOD0
Operation mode
select bit 0, 1
TXMOD1
INT1/CNTR0
R0EDG
polarity
switching bit
Timer X count
TXS
start flag
TXOCNT
Must set to "0" in pulse period measurement mode
Operation mode
TXMOD2
select bit 2
Active edge
2
TXEDG
reception flag
Timer X
2
TXUND
underflow flag
page 78 of 184
Specification
1
Address
After reset
008B
00
16
16
Function
b1 b0
0 0 : Pulse period measurement mode
0: Measures a measurement pulse from one
rising edge to the next rising edge
1: Measures a measurement pulse from one
1
falling edge to the next falling edge
0 : Stops counting
1 : Starts counting
1 : Pulse period measurement mode
0 : No active edge
1 : Active edge found
0 : No under flow
1 : Under flow found
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