Operation; Operation As The Interval Timer; Operation As The Auto Reload Timer; Event Counter - Renesas Hitachi H8S/2194 Series Hardware Manual

16-bit single-chip microcomputer
Table of Contents

Advertisement

13.3

Operation

13.3.1

Operation as the Interval Timer

When the TMB17 bit of the TMB is set to 0, the Timer B works as an 8-bit interval timer.
When reset, since the TCB is cleared to H'00 and as the TMB17 bit is cleared to 0, the Timer B
continues counting up as the interval timer without interrupts right after resetting.
As the clock source for the Timer B, selection can be made from seven different types of
internal clocks being output from the prescaler unit by the TMB12 to TMB10 bits of the TMB or
an external clock through the TMBI input pin can be chosen instead.
When the clock signal is input after the reading of the TCB reaches H'FF, the Timer B overflows
and the TMBIF bit of the TMB will be set to 1. At this time, when the TMBIE bit of the TMB is
1, interrupt occurs.
When overflowing occurs, the reading of the TCB returns to H'00 before resuming counting up.
When a value is set to the TLB while the interval timer is in operation, the value which has been
set to the TLB will be loaded to the TCB simultaneously.
13.3.2

Operation as the Auto Reload Timer

When the TMB17 of the TMB is set to 1, the Timer B works as an 8-bit auto reload timer.
When a reload value is set in the TLB, the value is loaded onto the TCB at the same time, and
the TCB starts counting up from the value.
When the clock signal is input after the reading of the TCB reaches H'FF, the Timer B overflows
and the TLB value is loaded onto the TCB, then the TCB continues counting up from the loaded
value. Accordingly, overflow interval can be set within the range of 1 to 256 clocks depending
on the TLB value.
Clock source and interrupts in the auto reload operation are the same as those in the interval
operation. When the TLB value is re-set while the auto reload timer is in operation, the value
which has been set to the TLB will be loaded onto the TCB simultaneously.
13.3.3

Event Counter

The Timer B works as an event counter using the TMBI pin as the event input pin. When the
TMB12 to TMB10 are set to 111, the external event will be selected as the clock source and the
TCB counts up at the leading edge or the trailing edge of the TMBI pin inputs.
Rev. 2.0, 11/00, page 302 of 1037

Advertisement

Table of Contents
loading

Table of Contents