
7-21
ML63326 User's Manual
Chapter 7 Timers (TIMER)
7
7.4.7 Frequency Measurement Mode Operation
The frequency measurement mode is used to measure the frequency of the RC oscillator
clock, which has wide product variation.
Timers 0 and 1, and timers 2 and 3 can be used in the frequency measurement mode. These
timers are set as follows for the frequency measurement mode:
•
Timer 0:
Set FMEAS0 (bit 2 of TM0CON0) to "1", and set TM0ECAP (bit 1 of
TM0CON0) and TM0RUN (bit 0 of TM0CON0) to "0".
•
Timer 1:
Set TM1ECAP (bit 1 of TM1CON0) and TM1RUN (bit 0 of TM1CON0)
to "0".
•
Timer 2:
Set FMEAS2 (bit 2 of TM2CON0) to "1", and set TM2RUN (bit 0 of
TM2CON0) to "0".
•
Timer 3:
Set TM3RUN (bit 0 of TM3CON0) to "0".
Figure 7-11 indicates frequency measurement mode timing when timers 2 and 3 are used as
a 16-bit timer.
FFFF
N1
TM3CH
TM3CL
TM2CH
TM2CL
TM3DH, TM3DL
TM2DH, TM2DL
64 Hz
437C
FMEAS2
437/32768 s
(H)
q
Ø
t
Ø
e
≠
w
r
≠
0000
Figure 7-11 Frequency Measurement Mode Timing
The operation sequence for Figure 7-11 is as follows.
q
Timer 3 control registers 0 and 1 (TM3CON0, TM3CON1) are set for 16-bit timer
mode, and the timer counter and timer data register are cleared to "0". Enable the
high-speed clock by the frequency control register (FCON) and the timer clock is
set to HSCLK.
w
Wait 10 ms or more in the crystal oscillation mode or 5 ms or more in the RC
oscillation mode after starting the high-speed clock and set FMEAS2 to "1" to enter
the frequency measurement mode.
e
When FMEAS2 is "1", the counter starts at the 64 Hz falling edge.
r
When the 437C signal is "1", FMEAS2 is reset to "0", and the counter stops at the
falling edge of the next clock. The 437C signal is a pulse signal which rises in 437/
32768 seconds after the 64 Hz falling edge.
t
Timer counter register value N1 is read.
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 ...