Datasheet

Section 15 Timer RC
Page 496 of 982 REJ09B0465-0300 Rev. 3.00
Sep 17, 2010
H8S/20103, H8S/20203, H8S/20223, H8S/20115, H8S/20215, H8S/20235 Group
TRCCNT
Previous clock
N
N + 1 N + 2 N + 3
New clock
Counter clock
The rising edge may occur depending on the timing
of changing bits CKS2 to CKS0. In this case, TRCCNT
counts up.
Figure 15.38 Internal Clock Switching and TRCCNT Operation
5. The TOA to TOD bits in TRCCR1 decide the output value of the FTIO pin until the first
compare match occurs. Once a compare match occurs and this compare match changes the
values of FTIOA to FTIOD output, the values of the FTIOA to FTIOD pin output and the
values read from the TOA to TOD bits may differ. Moreover, when the writing to TRCCR1
and the generation of the compare match A to D occur at the same timing, the writing to
TRCCR1 has the priority. Thus, output change due to the compare match is not reflected to the
FTIOA to FTIOD pins. Therefore, when bit manipulation instruction is used to write to
TRCCR1, the values of the FTIOA to FTIOD pin output may result in an unexpected result.
When TRCCR1 is to be written to while compare match is operating, stop the counter once
before accessing to TRCCR1, read the port H state to reflect the values of FTIOA to FTIOD
output, to TOA to TOD, and then restart the counter. Figure 15.39 shows an example when the
compare match and the bit manipulation instruction to TRCCR1 occur at the same timing.