English
Language : 

M16C80 Datasheet, PDF (121/358 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/80 SERIES
M16C/80 Group
14. Timer B
(3) Pulse period/pulse width measurement mode
In this mode, the timer measures the pulse period or pulse width of an external signal. (See Table 14.3)
Figure 14.6 shows the timer Bi mode register in pulse period/pulse width measurement mode. Figure
14.7 shows the operation timing when measuring a pulse period. Figure 14.8 shows the operation timing
when measuring a pulse width.
Table 14.3 Timer specifications in pulse period/pulse width measurement mode
Item
Specification
Count source
Count operation
f1, f8, f32, fc32
• Up count
• Counter value “000016” is transferred to reload register at measurement
pulse's effective edge and the timer continues counting
Count start condition
Count stop condition
Count start flag is set (= 1)
Count start flag is reset (= 0)
Interrupt request generation timing • When measurement pulse's effective edge is input (Note 1)
• Timer overflow. When an overflow occurs, the timer Bi overflow flag set to “1”
simultaneously. The timer Bi overflow flag cleared to “0” by writing to the
timer mode register at the next count timing or later after the timer Bi overflow
flag was set to "1". At this time, make sure the timer start flag is set to "1".
TBiIN pin function
Measurement pulse input (Set the corresponding function select register A to I/O port.)
Read from timer
When timer Bi register is read, it indicates the reload register’s content
(measurement result) (Note 2)
Write to timer
Cannot be written to
Note 1: An interrupt request is not generated when the first effective edge is input after the timer has started counting.
Note 2: The value read out from the timer Bi register is indeterminate until the second effective edge is input after the timer.
Timer Bi mode register
b7 b6 b5 b4 b3 b2 b1 b0
10
Symbol
Address
TBiMR(i = 0 to 5) 035B16 to 035D16
031B16 to 031D16
When reset
00XX00002
00XX00002
Bit symbol
TMOD0
TMOD1
Bit name
Operation mode
select bit
Function
b1 b0
1 0 : Pulse period / pulse width
measurement mode
RW
MR0
MR1
Measurement mode
select bit
b3 b2
0 0 : Pulse period measurement (Interval between
measurement pulse's falling edge to falling edge)
0 1 : Pulse period measurement (Interval between
measurement pulse's rising edge to rising edge)
1 0 : Pulse width measurement (Interval between
measurement pulse's falling edge to rising edge,
and between rising edge to falling edge)
1 1 : Must not be set
MR2
0 (Set to “0” in pulse period/pulse width measurement mode; i = 0, 3)
(Note 2)
Nothing is assigned (i = 1, 2, 4, 5).
When write, set "0". When read, its content is indeterminate.
(Note 3)
MR3
Timer Bi overflow
flag ( Note 1)
0 : Timer did not overflow
1 : Timer has overflowed
TCK0
TCK1
Count source
select bit
b7 b6
0 0 : f1
0 1 : f8
1 0 : f32
1 1 : fC32
Note 1: This flag is indeterminate after reset. When the timer Bi start flag = 1, the timer Bi overflow flag is
cleared to "0" by writing to the timer Bi mode register at the next count timing or later after the timer Bi
overflow flag was set to "1". The Timer Bi overflow flag cannot be set to "1" in a program.
Note 2: Timer B0, timer B3.
Note 3: Timer B1, timer B2, timer B4, timer B5.
Figure 14.6 Timer Bi mode register in pulse period/pulse width measurement mode
Rev.1.00 Aug. 02, 2005 Page 110 of 329
REJ09B0187-0100