Datasheet
Section 13 Timer RA
REJ09B0465-0300 Rev. 3.00 Page 411 of 982
Sep 17, 2010
H8S/20103, H8S/20203, H8S/20223, H8S/20115, H8S/20215, H8S/20235 Group
13.3 Operation
13.3.1 Operations Common to Various Modes
(1) Starting and Stopping Operation
Writing the value 1 to the TSTART bit in TRACR starts counting in a set operating mode; writing
the value 0 to the TSTART bit stops the counting. The prescaler counts down in the counter clock
cycle to be input into the prescaler. The timer counts down using the underflow of the prescaler as
a count source.
(2) Forced Termination of Operation
Writing 1 to the TSTOP bit in TRACR stops the counting forcibly. When the counting is stopped,
the timer counter, the prescaler counter, and any associated flags are initialized while the reload
registers of the prescaler and the timer counter are retained.
(3) Interrupt Request
An interrupt request is generated on the underflow of the timer RA counter.
(4) Reading and Writing Count Value
Reading registers TRAPRE and TRATR reads count values from each register. If a write is
performed to TRAPRE or TRATR when the counting is stopped, a specified value is written to
both the reload register and the counter.
If a write is performed to the TRAPRE register during counting, first a set value is written to the
reload register in synchronization with the count source after four cycles of count source, and the
set value is then transferred to the prescaler counter in synchronization with the next count source.
If a write is performed to the TRATR register, a set value is written to the reload register in
synchronization with the underflow of the prescaler after four cycles of count source, and the set
value is transferred to the timer counter in synchronization the next underflow of the prescaler. For
this reason, if a write is performed to TRAPRE or TRATR during counting, the value of the
counter is not updated immediately after the execution of the write command. Figure 13.2 shows
an example operation where a count value is rewritten when the timer RA is counting.