Datasheet

Section 13 Timer RA
REJ09B0465-0300 Rev. 3.00 Page 417 of 982
Sep 17, 2010
H8S/20103, H8S/20203, H8S/20223, H8S/20115, H8S/20215, H8S/20235 Group
Timer RA prescaler
underflow signal
1.
2.
3.
4.
5.
6.
When TRATR is read in pulse cycle measurement mode, the value in the read buffer can be read.
The TEDGF bit in TRACR is set to 1 (valid edge exists) on the second underflow of the timer RA
prescaler after a valid edge of the measurement pulses is input.
TRATR should be read between the TEDGF bit setting to 1 (valid edge exists) and the next
valid edge input.
The value in the read buffer is retained until TRATR is read. Therefore, if the value is not read
before the next valid edge input, the measurement result of the previous cycle remains.
The MOV instruction should be used to write 0 to the TEDGF bit in TRACR using a program.
Here, 1 should be written to the TUNDF bit .
The MOV instruction should be used to write 0 to the TUNDF bit in TRACR using a program.
Here, 1 should be written to the TEDGF bit.
If an underflow of timer RA and reloading of timer RA by valid edge input occur at the same time,
both the TUNDF and TEDGF bits are set to 1. In this case, the effectiveness of the TUNDF bit should
be determined according to the read buffer contents.
H'0E H'0D H'0F H'0E H'0D H'0C H'0B H'0A H'09 H'0F H'0E H'0D H'01 H'00 H'0F H'0EH'0F
H'0DH'0F H'0B H'0A H'0D H'01 H'00 H'0F H'0EH'09
TSTART in TRACR
TEDGF in TRACR
"1"
"0"
"1"
"0"
"1"
"0"
"1"
"0"
"1"
"0"
Measurement pulse
(TRAIO pin input)
TRATR content
Read buffer content *
1
TUNDF in TRACR
TRAIF in TRAIR
Start counting
TRA read (
*
3)
Retained
Set to 0 by a program.
*4
*2
*2
Set to 0 by a program.
*5
*6
Set to 0 by a program.
Measurement condition:
H'0E
TRA reloadTRA reload
Retained
Underflow
Set to 1 by a program.
The initial value of TRATR is H'0F and the width from the rising edge to the next rising edge
of measurement pulse is measured (TEDGSEL = 0).
Notes:
Figure 13.4 Operation Example of Pulse Cycle Measurement Mode