Download Print this page

Renesas M16C/50 Series User Manual page 817

Advertisement

M16C/5L Group, M16C/56 Group
28.12 Notes on Timer B
28.12.1 Common Notes on Multiple Modes
28.12.1.1 Register Setting
The timer is stopped after reset. Set the mode, count source, etc., using registers TBiMR, TBCS0 to
TBCS1, TBi, PCLKR and PPWFS1 before setting the TBiS bit in the TABSR register to 1 (count started)
(i = 0 to 2).
Rewrite registers TBiMR, TBCS0 to TBCS1, PCLKR, and PPWFS1 while the TBiS bit is 0 (count
stopped), regardless of whether after reset or not.
28.12.2 Timer B (Timer Mode)
28.12.2.1 Reading the Timer
While counting, the counter value can be read at any time by reading the TBi register. However,
FFFFh is read while reloading. When the counter is read before it starts counting and after a value is
set in the TBi register while not counting, the set value is read.
28.12.3 Timer B (Event Counter Mode)
28.12.3.1 Reading the Timer
While counting, the counter value can be read at any time by reading the TBi register. However,
FFFFh is read while reloading. When the counter is read before it starts counting and after a value is
set in the TBi register while not counting, the set value is read.
28.12.3.2 Event
When the TCK1 bit in the TBiMR register is 1, an event occurs when an interrupt request of the
selected timer is generated. An event or trigger occurs while an interrupt is disabled because an
interrupt request signal is generated regardless of the I flag, IPL, or interrupt control registers.
When the timer selected by the TCK1 bit uses pulse-period measurement mode or pulse-width
measurement mode, an interrupt request is generated at an active edge of the measurement pulse.
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
28. Usage Notes
Page 780 of 803

Advertisement

loading