
R01UH0336EJ0102 Rev.1.02
Page 945 of 1538
Jul 17, 2014
V850E2/PG4-L
Section 17 OS Timer (OSTM)
17.3.4
Starting and Stopping the Timer
The OS timer is started and stopped as follows.
Starting
the timer
The timer is started in either of the following ways:
• setting the OSTMnTS.OSTMnTS bit to 1 or
• placing the high level on the OSTMnTSST signal (when starting
synchronous counting).
Status bit OSTMnTE.OSTMnTE is set to 1.
The counter starts to count up or down in accord with the settings for operating
mode. For details, refer to Section 17.3.5, Interval Timer Mode and Section
17.3.6, Free-Running Comparison Mode.
Stopping
the timer
Setting the OSTMnTT.OSTMnTT bit to 1 stops the timer.
This also clears the OSTMnTE.OSTMnTE status flag.
When the counter is stopped, values in the OSTMnTO and OSTMnCNT
registers and the level of the OSTMnTTOUT output are retained until further
counting operations start.
Synchronous
start
The OSTMnTSST signal output from the PIC module can be used to start
multiple timers at the same time.
Refer to Section 24, Peripheral Interconnection (PIC).
Initialization
To initialize interval timer mode and free-running comparison mode after reset
release, take the following steps.
1. Set the value where the down-counter is to start counting or the value for
comparison in the OSTMnCMP register.
2. In case of output (OSTMnTTOUT) toggling:
– initialize the OSTMnTO register during operation in software control
mode (OSTMnTOE.OSTMnTOE = 0) and
– select timer-output toggling (OSTMnTOE.OSTMnTOE = 1).
3. Set the OSTMnCTL.OSTMnMD1 bit to select interval timer mode or free-
running comparison mode.
4. Select the interrupt mode for the start of counting
(OSTMnCTL.OSTMnMD0 = 1 or 0).
Содержание V850 Series
Страница 1556: ...V850E2 PG4 L R01UH0336EJ0102 Back Cover ...