|
M16C62_M Datasheet, PDF (363/615 Pages) Renesas Technology Corp – 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/60 SERIES | |||
|
◁ |
Timer B
Mitsubishi microcomputers
M16C / 62A Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
2.3.4 Operation of Timer B (pulse period measurement mode)
In pulse period/pulse width measurement mode, choose functions from those listed in Table 2.3.3. Op-
erations of the circled items are described below. Figure 2.3.8 shows the operation timing, and Figure
2.3.9 shows the set-up procedure.
Table 2.3.3. Choosed functions
Item
Set-up
Count source O Internal count source (f1 / f8 / f32 / fc32)
Measurement O Pulse period measurement (interval between measurement pulse falling edge to falling edge)
mode
Pulse period measurement (interval between measurement pulse rising edge to rising edge)
Pulse width measurement (interval between measurement pulse falling edge to rising edge,
and between rising edge to falling edge)
Operation (1) Setting the count start flag to â1â causes the counter to start counting the count source.
(2) If a measurement pulse changes from âHâ to âLâ, the value of the counter goes to â000016â,
and measurement is started. In this instance, an indeterminate value is transferred to the
reload register. The timer Bi interrupt request does not generate.
(3) If a measurement pulse changes from âHâ to âLâ again, the value of the counter is transferred
to the reload register, and the timer Bi interrupt request bit goes to â1â. Then the value of the
counter becomes â000016â, and the measurement is started again.
Note
⢠The timer Bi interrupt request bit goes to â1â when an effective edge of a measurement pulse is
input or timer Bi is overflowed. The factor of interrupt request can be determined by use of the
timer Bi overflow flag within the interrupt routine.
⢠The value of the counter at the beginning of a count is indeterminate. Therefore, the timer Bi
overflow flag may go to â1â and timer Bi interrupt request may be generated during the interval
between a count start and an effective edge input.
⢠The timer Bi overflow flag is indeterminate after reset. The timer Bi overflow flag goes to â0â if
timer Bi mode register is written to when the count start flag is â1â. This flag cannot be set to â1â
by software.
Measurement of pulse time interval from falling edge to falling edge
(1) Start count
(2) Start measurement (3) Start measurement again
Count source
âHâ
Measurement pulse
âLâ
Reload register â counter
transfer timing
Timing at which counter
reaches â000016â
â1â
Count start flag
â0â
(Note 1)
Transfer
(indeterminate value)
(Note 1)
Transfer
(measured value)
(Note 2)
Cleared to â0â when interrupt request is accepted, or cleared by software
Timer Bi interrupt
â1â
request bit
â0â
Timer Bi overflow flag
â1â
â0â
Note 1: Counter is initialized at completion of measurement.
Note 2: Timer has overflowed.
Figure 2.3.8. Operation timing of pulse period measurement mode
2-46
|
▷ |