
267
Section 11 16-Bit Free-Running Timer
11.1
Overview
The H8S/2138 Series and H8S/2134 Series have a single-channel on-chip 16-bit free-running
timer (FRT) module that uses a 16-bit free-running counter as a time base. Applications of the
FRT module include rectangular-wave output (up to two independent waveforms), input pulse
width measurement, and measurement of external clock periods.
11.1.1
Features
The features of the free-running timer module are listed below.
Selection of four clock sources
The free-running counter can be driven by an internal clock source (/2, /8, or /32), or
an external clock input (enabling use as an external event counter).
Two independent comparators
Each comparator can generate an independent waveform.
Four input capture channels
The current count can be captured on the rising or falling edge (selectable) of an input
signal.
The four input capture registers can be used separately, or in a buffer mode.
Counter can be cleared under program control
The free-running counters can be cleared on compare-match A.
Seven independent interrupts
Two compare-match interrupts, four input capture interrupts, and one overflow interrupt
can be requested independently.
Special functions provided by automatic addition function
The contents of OCRAR and OCRAF can be added to the contents of OCRA
automatically, enabling a periodic waveform to be generated without software
intervention.
The contents of ICRD can be added automatically to the contents of OCRDM × 2,
enabling input capture operations in this interval to be restricted.