English
Language : 

HD6473837H Datasheet, PDF (223/562 Pages) Renesas Technology Corp – Hardware Manual
9.5.4 Timer Operation
Timer F is a 16-bit timer/counter that increments with each input clock. The value set in output
compare register F is constantly compared with the value of timer counter F, and when they match
the counter can be cleared, an interrupt can be requested, and the port output can be toggled. Timer
F can also be used as two independent 8-bit timers.
Timer F Operation: Timer F can operate in either 16-bit timer mode or 8-bit timer mode. These
modes are described below.
• 16-bit timer mode
Timer F operates in 16-bit timer mode when the CKSH2 bit in timer control register F (TCRF)
is cleared to 0.
A reset initializes timer counter F (TCF) to H'0000, output compare register F (OCRF) to
H'FFFF, and timer control register F (TCRF) and timer control status register F (TCSRF) to
H'00. Timer F begins counting external event input signals (TMIF). The edge of the external
event signal is selected by the IEG3 bit in the IRQ edge select register (IEGR).
Any of four internal clocks output by prescaler S, or an external clock, can be selected as the
timer F operating clock by bits CKSL2 to CKSL0 in TCRF.
TCF is continuously compared with the contents of OCRF. When these two values match, the
CMFH bit in TCSRF is set to 1. At this time if IENTFH of IENR2 is 1, a CPU interrupt is
requested and the output at pin TMOFH is toggled. If the CCLRH bit in TCSRF is 1, timer F is
cleared. The output at pin TMOFH can also be set by the TOLH bit in TCRF.
If timer F overflows (from H'FFFF to H'0000), the OVFH bit in TCSRF is set. At this time, if
the OVIEH bit in TCSRF and the IENTFH bit in IENR2 are both 1, a CPU interrupt is
requested.
• 8-bit timer mode
When the CKSH2 bit in TCRF is set to 1, timer F operates as two independent 8-bit timers,
TCFH and TCFL. The input clock of TCFH/TCFL is selected by bits CKSH2 to
CKSH0/CKSL2 to CKSL0 in TCRF.
When TCFH/TCFL and the contents of OCRFH/OCRFL match, the CMFH/CMFL bit in
TCSRF is set to 1. If the IENTFH/IENTFL bit in IENR2 is 1, a CPU interrupt is requested and
the output at pin TMOFH/TMOFL is toggled. If the CCLRH/CCLRL bit in TCRF is 1,
TCFH/TCFL is cleared. The output at pin TMOFH/TMOFL can also be set by the
TOLH/TOLL bit in TCRF.
When TCFH/TCFL overflows from H'FF to H'00, the OVFH/OVFL bit in TCSRF is set to 1.
At this time, if the OVIEH/OVIEL bit in TCSRF and the IENTFH/IENTFL bit in IENR2 are
both 1, a CPU interrupt is requested.
206