14 8-BiT OSC1 TiMeR (T8OSC1)
14-2
Seiko epson Corporation
S1C17624/604/622/602/621 TeChniCal Manual
Count Clock
14.3
The T8OSC1 module includes a divider and a gate circuit for controlling the count clock.
Clock division ratio selection
The T8OSC1 module generates the count clock by dividing the OSC1 clock output from the CLG.
Use T8O1CK[2:0]/OSC_T8OSC1 register to select the division ratio.
3.1 OSC1 Division Ratio Selection
Table 14.
T8O1CK[2:0]
Division ratio
0x7–0x6
Reserved
0x5
1/32
0x4
1/16
0x3
1/8
0x2
1/4
0x1
1/2
0x0
1/1
(Default: 0x0)
Clock enable
The count clock supply is enabled with T8O1CE/OSC_T8OSC1 register. The T8O1CE default setting is 0,
which stops the clock. Setting T8O1CE to 1 feeds the clock generated as above to the counter. If no T8OSC1
operation is required, stop the clock to reduce current consumption.
note: Be sure to set T8O1CE to 0 before selecting a clock division ratio.
Count Mode
14.4
T8OSC1 features two count modes: Repeat mode and One-shot mode. These modes are selected using T8ORMD/
T8OSC1_CTL register.
Repeat mode (T8ORMD = 0, default)
Setting T8ORMD to 0 sets T8OSC1 to repeat mode.
In this mode, once the count starts, the timer continues running until stopped by the application program. If the
counter matches the compare data, the timer resets the counter and continues counting. The interrupt signal is
output at the same time. T8OSC1 should be set to this mode to generate periodic interrupts at desired intervals
or to perform PWM output.
One-shot mode (T8ORMD = 1)
Setting T8ORMD to 1 sets T8OSC1 to One-shot mode.
In this mode, the timer stops automatically as soon as the counter matches the compare data. This means only
one interrupt can be generated after the timer starts. Note that the timer resets the counter, then stops after a
complete match has occurred. T8OSC1 should be set to this mode to set a specific wait time.
notes: • Make sure the timer count is halted before changing count mode settings.
• If count operation is activated while the count mode is set to one-shot mode, and the CPU en-
ters halt state, the counter does not stop even when a compare match occurs, disabling one-
shot operation.