Pulse Period Measurement Mode - Renesas M16C Series Hardware Manual

16-bit microcopmuter
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

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
NOTES:
1. 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.
T i m e r X m o d e r e g i s t e r
b 7 b 6 b 5 b4 b 3 b2 b 1 b 0
1
0
N O T E S :
1 . T h e I R b i t i n t h e I N T 1 I C r e g i s t e r m a y b e s e t t o " 1 " ( i n t e r r u p t r e q u e s t e d ) w h e n t h e R 0 E D G b i t i s r e w r i t t e n .
R e f e r t o t h e p a r a g r a p h 1 9 . 2 . 5 " C h a n g i n g I n t e r r u p t F a c t o r " i n t h e U s a g e N o t e s R e f e r e n c e B o o k .
2 . T h i s b i t i s s e t t o " 0 " b y w r i t i n g " 0 " i n a p r o g r a m . ( I t r e m a i n s u n c h a n g e d e v e n i f w r i t i n g " 1 " )
Figure 12.9 TXMR Register in Pulse Period Measurement Mode
Rev.1.20
Jan 27, 2006
REJ09B0062-0120
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.
S y m b o l
T X M R
0 0
Bit symbol
B i t n a m e
T X M O D 0
Operation mode
select bit 0, 1
T X M O D 1
INT1/CNTR0
R0EDG
polarity
switching bit
Timer X count
T X S
start flag
T X O C N T
S e t t o " 0 " i n p u l s e p e r i o d m e a s u r e m e n t m o d e
O p e r a t i o n m o d e
T X M O D 2
s e l e c t b i t 2
A c t i v e e d g e
(2 )
T X E D G
j u d g m e n t f l a g
T i m e r X
(2 )
T X U N D
u n d e r f l o w f l a g
page 78 of 204
Specification
(1)
(INT1 interrupt input)
A d d r e s s
A f t e r r e s e t
0 0 8 B
0 0
1 6
1 6
Function
b1 b0
0 0 : Timer mode or pulse period
measurement mode
[CNTR
]
0
0: Measures a measurement pulse from one
(1)
rising edge to the next rising edge
1: Measures a measurement pulse from one
falling edge to the next falling edge
[INT1]
0: Rising edge
1: Falling edge
0 : S t o p s c o u n t i n g
1 : S t a r t s c o u n t i n g
1 : P u l s e p e r i o d m e a s u r e m e n t m o d e
0 : No active edge
1 : Active edge found
0 : N o u n d e r f l o w
1 : U n d e r f l o w f o u n d
12.1 Timer (Timer X)
_____
RW
R W
R W
R W
R W
R W
R W
R W
R W

Advertisement

Table of Contents
loading

This manual is also suitable for:

R8c/11 seriesR8c/tiny series

Table of Contents