Section 11 16-Bit Cycle Measurement Timer (TCM)
Rev. 1.00 Apr. 28, 2008 Page 320 of 994
REJ09B0452-0100
(2) Measuring a Cycle
In cycle measurement mode, one cycle of the input waveform for TCM form one measurement
cycle. Start by setting TCMMDS
=
0 and then set CST
=
0, which clears TCMCNT to H'0000.
After that, set an upper or lower limit on the measurement cycle in the TCMMLCM/TCMMINCM
register. Finally, place the timer in cycle measurement mode by setting the TCMMDS bit in
TCMCR to 1. TCMCNT will count cycles of the selected clock. On detection of the first edge
(either rising or falling as selected with the IEDG bit in TCMCR) of the measurement cycle,
TCMCNT is automatically cleared to H'0000. On detection of the second edge, the value in
TCMCNT is transferred to TCMICR. At this time, the value in TCMICR is compared with the
value in TCMMLCM/TCMMINCM. If TCMICR is larger than TCMMLCM, the MAXOVF bit in
TCMCSR is set to 1. If TCMICR is smaller than TCMMINCM, the MINUDF bit in TCMCSR is
set to 1. If generation of the corresponding interrupt request is enabled by the setting in TCMIER,
the request is generated. In addition, on detection of the third edge, TCMCNT is cleared to
H'0000, and the next round of measurement starts.
When the CPSPE bit in TCMCR has been cleared to 0, the next round of cycle measurement will
start, even if the MAXOVF/MINUDF flag is set to 1.
If the MAXOVF/MINUDF flag is set to 1 while the CPSPE bit in TCMCR is set to 1, counting up
by TCMCNT stops and so does cycle measurement. Subsequently clearing MAXOVF/MINUDF
to 0 automatically clears TCMCNT to H'0000, and counting up for cycle measurement is then
restarted.
Figure 11.8 shows an example of timing in speed measurement.
H'0001
H'0000
H'0001
N - 1
H'0000
N
M
TCMCNT
clear signal
TCMCNT
input clock
TCMCNT
N
M
L
M
L
K
φ
TCMCYI
TCMICR
MAXOVF/
MINUDF
TCMICRF
Figure 11.8 Example of Timing in Cycle Measurement
Summary of Contents for H8S/2100 Series
Page 2: ...Rev 1 00 Apr 28 2008 Page ii of xxvi...
Page 54: ...Section 1 Overview Rev 1 00 Apr 28 2008 Page 28 of 994 REJ09B0452 0100...
Page 92: ...Section 2 CPU Rev 1 00 Apr 28 2008 Page 66 of 994 REJ09B0452 0100...
Page 158: ...Section 5 Interrupt Controller Rev 1 00 Apr 28 2008 Page 132 of 994 REJ09B0452 0100...
Page 244: ...Section 8 8 Bit PWM Timer PWMU Rev 1 00 Apr 28 2008 Page 218 of 994 REJ09B0452 0100...
Page 330: ...Section 10 16 Bit Timer Pulse Unit TPU Rev 1 00 Apr 28 2008 Page 304 of 994 REJ09B0452 0100...
Page 416: ...Section 13 8 Bit Timer TMR Rev 1 00 Apr 28 2008 Page 390 of 994 REJ09B0452 0100...
Page 612: ...Section 18 I 2 C Bus Interface IIC Rev 1 00 Apr 28 2008 Page 586 of 994 REJ09B0452 0100...
Page 706: ...Section 20 LPC Interface LPC Rev 1 00 Apr 28 2008 Page 680 of 994 REJ09B0452 0100...
Page 752: ...Section 21 FSI Interface Rev 1 00 Apr 28 2008 Page 726 of 994 REJ09B0452 0100...
Page 774: ...Section 23 RAM Rev 1 00 Apr 28 2008 Page 748 of 994 REJ09B0452 0100...
Page 1008: ...Section 28 Electrical Characteristics Rev 1 00 Apr 28 2008 Page 982 of 994 REJ09B0452 0100...
Page 1020: ...Rev 1 00 Apr 28 2008 Page 994 of 994 REJ09B0452 0100...
Page 1023: ......
Page 1024: ...H8S 2117R Group Hardware Manual...