Datasheet
Section 11 16-Bit Cycle Measurement Timer (TCM)
Rev. 3.00 Sep. 28, 2009 Page 323 of 910
REJ09B0350-0300
(4) Example of Settings for Cycle Measurement Mode
Figure 11.12 shows an example of the flow when cycle measurement mode is to be used.
Start
Initialization
Set TCMMDS to 0
Set CST (TCMCR) to 0
Set TCMMLCM
Set OVIE and MAXOVIE to 1
Set TCMMDS to 1
Yes
No
Yes
No
Interrupt is generated
Processing for
external event stopped state
Processing for cycle
upper limit over
End of exception handling
Set TCMMDS = 0
End of measurement
OVF = 1? or
MAXOVF = 1?
MAXOVF = 1?
[1]
[2]
[3]
[5]
[6]
[1]
[2]
[3]
[5]
[6]
[9]
[9]
[7]
[7]
[8]
[8]
Set timer mode.
Stop TCMCNT and initialize to H'0000.
Set an upper limit on the measurement period.
Enable interrupts.
Set speed measurement mode
to start speed measurement.
Speed measurement is completed.
Processing for the external event stopped state.
Processing for cycle upper limit over.
Set TCMIPE = 1
[4]
[4]
Pin input enabled.
Figure 11.12 Example of Cycle Measurement Mode Settings