Datasheet
Section 14 Timer RD
Rev. 1.50 Sep. 18, 2007 Page 357 of 584
REJ09B0240-0150
(10) Note on Writing to the TOA0 to TOD0 Bits and the TOA1 to TOD1 Bits in TRDOCR
The TOA0 to TOD0 bits and the TOA1 to TOD1 bits in TRDOCR decide the value of the FTIO
pin, which is output until the first compare match occurs. Once a compare match occurs and this
compare match changes the values of FTIOA0 to FTIOD0 and FTIOA1 to FTIOD1 output, the
values of the FTIOA0 to FTIOD0 and FTIOA1 to FTIOD1 pin output and the values read from the
TOA0 to TOD0 and TOA1 to TOD1 bits may differ. Moreover, when the writing to TRDOCR
and the generation of the compare match A0 to D0 and A1 to D1 occur at the same timing, the
writing to TRDOCR has the priority. Thus, output change due to the compare match is not
reflected to the FTIOA0 to FTIOD0 and FTIOA1 to FTIOD1 pins. Therefore, when bit
manipulation instruction is used to write to TRDOCR, the values of the FTIOA0 to FTIOD0 and
FTIOA1 to FTIOD1 pin output may result in an unexpected result. When TRDOCR is to be
written to while compare match is operating, stop the counter once before accessing to TRDOCR,
read the port 6 state to reflect the values of FTIOA0 to FTIOD0 and FTIOA1 to FTIOD1 output,
to TOA0 to TOD0 and TOA1 to TOD1, and then restart the counter. Figure 14.69 shows an
example when the compare match and the bit manipulation instruction to TRDOCR occur at the
same timing.










