
7-14
ML63326 User's Manual
Chapter 7 Timers (TIMER)
7.4 Timer Operation
7.4.1 Timer Clock
The timer clock can be selected as TBCCLK (low-speed clock: 32.768 kHz), HSCLK (high-
speed clock), or an external clock. By using timer 0 and timer 2 overflow signals as clocks for
timer 1 and timer 3, respectively, the timers can be used in pairs as 16-bit timers.
If the high-speed clock (HSCLK) is to be used, after setting bit 1 (ENOSC) of the frequency
control register (FCON), wait at least 10 ms in the crystal oscillation mode or 5 ms in the RC
oscillation mode before operating the timer.
The external clock is input to a port assigned as a secondary function port. In the case of
timers 0 and 2, PB.2/T02CK is used as the input pin for the external clock. In the case of timers
1 and 3, PB.3/T13CK is used as the input pin for the external clock. Since the external clock
is sampled by the system clock (CLK), the high- and low-levels of the external clock should
be longer than 1 cycle of the system clock (CLK).
7.4.2 Timer Data Registers
TM0DL, TM0DH, TM1DL, TM1DH, TM2DL, TM2DH, TM3DL and TM3DH are 4-bit registers.
In the auto-reload mode, the timer data registers save values that are reloaded into the timer
counter registers when the timer counter registers overflow.
In the capture mode, the timer data registers save the value of the timer counter registers
when a capture signal is input. Each timer data register can be read/written by software.
Writing to timer data registers does not change the contents of the timer counter registers.
7.4.3 Timer Counter Registers
TM0CL and TM0CH, TM1CL and TM1CH, TM2CL and TM2CH, and TM3CL and TM3CH are
8-bit binary counters that are incremented at the falling edge of the timer clock.
Each timer counter register can be read/written by software. However, if the CPU clock and
timer clock are different, values that are read or written during the count operation cannot be
guaranteed. If an external clock is used as the timer clock, reading/writing is always possible.
When a value is written to any timer counter register, the same value is also written to the
corresponding timer data register.
Summary of Contents for ML63326
Page 3: ......
Page 13: ......
Page 14: ...Chapter 1 Overview 1 ...
Page 15: ......
Page 37: ...1 22 ML63326 User s Manual Chapter 1 Overview ...
Page 38: ...Chapter 2 CPU and Memory Spaces 2 ...
Page 39: ......
Page 50: ...CPU Control Functions Chapter 3 3 ...
Page 51: ......
Page 57: ...3 6 ML63326 User s Manual Chapter 3 CPU Control Functions ...
Page 58: ...Interrupt INT326 Chapter 4 4 ...
Page 59: ......
Page 71: ...4 12 ML63326 User s Manual Chapter 4 Interrupt INT326 ...
Page 72: ...Clock Generator Circuit OSC Chapter 5 5 ...
Page 73: ......
Page 83: ...5 10 ML63326 User s Manual Chapter 5 Clock Generator Circuit OSC ...
Page 84: ...Time Base Counter TBC Chapter 6 6 ...
Page 85: ......
Page 90: ...Timers TIMER Chapter 7 7 ...
Page 91: ......
Page 115: ...7 24 ML63326 User s Manual Chapter 7 Timers TIMER ...
Page 116: ...Chapter 8 8 100 Hz Timer Counter 100HzTC ...
Page 117: ......
Page 121: ...8 4 ML63326 User s Manual Chapter 8 100 Hz Timer Counter 100HzTC ...
Page 122: ...Chapter 9 9 Watchdog Timer WDT ...
Page 123: ......
Page 128: ...Chapter 10 10 Ports INPUT OUTPUT I O PORT ...
Page 129: ......
Page 170: ...Chapter 11 11 External Memory Transfer Function EXTMEM ...
Page 171: ......
Page 179: ...11 8 ML63326 User s Manual Chapter 11 External Memory Transfer Function EXTMEM ...
Page 180: ...Chapter 12 12 Melody Driver MELODY63K ...
Page 181: ......
Page 195: ...12 14 ML63326 User s Manual Chapter 12 Melody Driver MELODY63K ...
Page 196: ...13 Chapter 13 Voice Synthesis ...
Page 197: ......
Page 228: ...14 Chapter 14 Shift Register SFT ...
Page 229: ......
Page 236: ...15 Chapter 15 LCD Driver LCD ...
Page 237: ......
Page 250: ...16 Chapter 16 Battery Low Detect Circuit BLD ...
Page 251: ......
Page 255: ...16 4 ML63326 User s Manual Chapter 16 Battery Low Detect Circuit BLD ...
Page 256: ...Chapter 17 17 Power Supply Circuit POWER ...
Page 257: ......
Page 260: ...Appendixes ...
Page 261: ......
Page 321: ...Appendix 60 ML63326 User s Manual Appendix G ...