Epson S1C17624 Technical Manual page 165

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

14 8-BiT OSC1 TiMeR (T8OSC1)
14.3
Count Clock
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.
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.
14.4
Count Mode
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.
14-2
Table 14.
3.1 OSC1 Division Ratio Selection
T8O1CK[2:0]
0x7–0x6
0x5
0x4
0x3
0x2
0x1
0x0
Seiko epson Corporation
Division ratio
Reserved
1/32
1/16
1/8
1/4
1/2
1/1
(Default: 0x0)
S1C17624/604/622/602/621 TeChniCal Manual

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17604S1c17622S1c17602S1c17621

Table of Contents