English
Language : 

M16C30L Datasheet, PDF (92/166 Pages) Renesas Technology Corp – SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
Mitsubishi microcomputers
M16C / 30L Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
(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 1.14.8.)
Figure 1.14.19 shows the timer Bi mode register in pulse period/pulse width measurement mode. Figure
1.14.20 shows the operation timing when measuring a pulse period. Figure 1.14.21 shows the operation
timing when measuring a pulse width.
Table 1.14.8. 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
Count start condition
pulse's effective edge and the timer continues counting
Count start flag is set (= 1)
Count stop condition
Count start flag is reset (= 0)
Interrupt request generation timing • When measurement pulse's effective edge is input (Note 1)
• When an overflow occurs. (Simultaneously, the timer Bi overflow flag
changes to “1”. Assume that the count start flag condition is “1” and then the
timer Bi overflow flag becomes “1”. If the timer Bi mode register has a write-
access after next count cycle of the timer from the above condition, the timer
Bi overflow flag becomes “0”.)
TBiIN pin function
Read from timer
Measurement pulse input
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 has started counting.
Timer Bi mode register
b7 b6 b5 b4 b3 b2 b1 b0
10
Symbol
TBiMR(i=1, 2)
Address
039C16, 039D16
When reset
00XX00002
Bit symbol
Bit name
TMOD0
TMOD1
Operation mode
select bit
Function
b1 b0
1 0 : Pulse period / pulse width
measurement mode
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.
RW
Nothing is assigned.
In an attempt to write to this bit, write “0”. The value, if read, turns out to be
indeterminate.
MR3
Timer Bi overflow
flag (Note)
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: It is indeterminate when reset. Assume that the count start flag condition is “1” and then the timer Bi
overflow flag becomes “1”. If the timer Bi mode register has a write access after next count cycle of
the timer from the above condition, the timer Bi overflow flag becomes “0”. This flag cannot be set
to “1” by software.
Figure 1.14.19. Timer Bi mode register in pulse period/pulse width measurement mode
91