Datasheet
Section 14 Timer RB
Page 430 of 982 REJ09B0465-0300 Rev. 3.00
Sep 17, 2010
H8S/20103, H8S/20203, H8S/20223, H8S/20115, H8S/20215, H8S/20235 Group
14.3.2 Programmable Waveform Generation Mode
This mode alternately reloads and counts values of TRBPR and TRBSC, and produces toggle
output from the TRBO pin each time the counter underflows. At the start of counting, this mode
counts beginning with the value assigned to TRBPR. TRBOCR is not used when programmable
waveform generation mode is used.
(1) Starting and Stopping Operation
Writing the value 1 to the TSTART bit in TRBCR starts counting; writing the value 0 to the
TSTART bit stops the counting.
(2) Forced Termination of Operation
Writing 1 to the TSTOP bit in TRBCR stops the counting forcedly. When the counting is forcedly
stopped, the timer RB counter, the prescaler counter, and any associated flags are initialized.
(3) Interrupt Request
An interrupt request is generated on the underflow of the timer RB counter during the secondary
period counting.
(4) Reading and Writing Count Value
Reading TRBPRE and TRBTR reads count values from each register.
If a write is performed to TRBPRE, TRBPR, or TRBSC when counting is stopped, set values are
written to both the reload register and the counter.
If a write is performed to TRBPRE, TRBPR, or TRBSC when counting is in progress, data is
written only to the respective reload registers. The output of a waveform reflects a set value
beginning with the next primary period after data is written to TRBPR.
However, if writing to TRBSC or TRBPR proceeds when the value of the counter is H'00,
updating of the waveform will be suspended for one cycle.