
R01UH0336EJ0102 Rev.1.02
Page 950 of 1538
Jul 17, 2014
V850E2/PG4-L
Section 17 OS Timer (OSTM)
17.3.6
Free-Running Comparison Mode
(1)
Basic Operation in Free-Running Comparison Mode
In free-running comparison mode, the counter counts up from 0000 0000
H
to
FFFF FFFF
H
. An OSTMnTINT interrupt request is output when the current
value of the counter matches the value of the OSTMnCMP register. The free-
running comparison mode is selected by setting the OSTMnCTL.OSTMnMD1
bit to 1.
New values can be written to the OSTMnCMP register at any time.
The following figure shows the basic operation of the OS timer in free-running
comparison mode with the start of counting enabled (OSTMnTS.OSTMnTS =
1) and OSTMnTTOUT output in timer-output toggling mode
(OSTMnTOE.OSTMnTOE = 1).
Figure 17-9
Timing Diagram of OS Timer in Free-Running Comparison Mode
The timing diagram above shows the following.
1. The counter starts counting when OSTMnTS.OSTMnTS = 1, or when
OSTMnTSST is high if the synchronous start trigger is in use. The
OSTMnTE.OSTMnTE bit is set to indicate enabling of the counter.
The counter counts up from 0000 0000
H
to FFFF FFFF
H
. The OSTMnCNT
register is the counter, so it contains the current value.
2. When the current counter value matches the value in the OSTMnCMP
register, an OSTMnTINT interrupt request is generated and the
OSTMnTTOUT output is toggled.
3. When the counter is stopped (OSTMnTT.OSTMnTT = 1), the
OSTMnTE.OSTMnTE bit is cleared to indicate disabling of the counter.
The counter retains its current value until it is restarted.
4. Counting by the counter restarts from 0000 0000
H
when
OSTMnTS.OSTMnTS = 1, or when OSTMnTSST is high if the
synchronous start trigger is in use.
OSTMnTS
or OSTMnTSST
OSTMnTE
OSTMnCNT
OSTMnCMP
OSTMnTINT
OSTMnTTOUT
OSTMnTT
FFFF FFFF
0000 0000 H
H
A B
C
D
E
A
B
C
D
E
A
(a) (b)
(c)
(d)
(1) (2)
(3)
(2) (2)
(2)
(2)
(4)
Содержание V850 Series
Страница 1556: ...V850E2 PG4 L R01UH0336EJ0102 Back Cover ...