English
Language : 

M16C65 Datasheet, PDF (805/829 Pages) Renesas Technology Corp – RENESAS MCU M16C FAMILY / M16C/60
Under development
M16C/65 Group
Preliminary Specification
This is a preliminary specification and is subject to change.
31. Precautions
31.16.3 Timer B (Pulse Period/Pulse Width Measurement Modes)
31.16.3.1 Register Setting
The timer is stopped after reset. Set the mode, count source, etc., using registers TBiMR, TBCS0 to
TBCS3, TBi, TCKDIVC0, PCLKR, PPWFS1, and PPWFS2 before setting the TBiS bit in the TABSR
or TBSR register to 1 (count starts) (i = 0 to 5).
Always make sure registers TBiMR, TBCS0 to TBCS3, TCKDIVC0, PCLKR, PPWFS1, and PPWFS2
are modified while the TBiS bit is 0 (count stops), regardless of whether after reset or not. To clear the
MR3 bit to 0 by writing to the TBiMR register while the TBiS bit is 1 (count starts), be sure to write the
same value as previously written to bits TMOD0, TMOD1, MR0, MR1, TCK0, and TCK1 and a 0 to bit
4.
31.16.3.2 Interrupts
The IR bit in the TBiIC register is set to 1 (interrupt requested) when an active edge of a measure-
ment pulse is input or timer Bi overflows (i = 0 to 5). The source of an interrupt request can be deter-
mined by using the MR3 bit in the TBiMR register within the interrupt routine.
Use the IR bit in the TBiIC register to detect overflows only. Use the MR3 bit only to determine the
interrupt source.
31.16.3.3 Operations between Count Start and the First Measurement
When a count is started and the first active edge is input, an undefined value is transferred to the
reload register. At this time, timer Bi interrupt request is not generated.
The value of the counter is undefined after reset. If count is started in this state, the MR3 bit may be
set to 1 and timer Bi interrupt request may be generated after count start before an effective edge is
input. When a value is set in the TBi register while the TBiS bit is 0 (count stops), the same value is
written to the counter.
31.16.3.4 Pulse Period Measurement Mode
When an overflow occurs at an active edge, an input is not recognized at the effective edge because
an interrupt request is generated only once. Use this mode where an overflow does not occur, or use
pulse width measurement.
31.16.3.5 Pulse Width Measurement Mode
In pulse width measurement, pulse widths are measured successively. Use a program to check
whether the measurement result is a high-level width or a low-level width.
When an interrupt request is generated, read the TBiIN pin level inside the interrupt routine, and
check whether it is the edge of an input pulse or an overflow. The TBiIN level can be read from bits in
the P9 register of corresponding ports.
REJ09B0484-0030 Rev.0.30 Sep 09, 2008
Page 770 of 791