Epson S1C17624 Technical Manual page 117

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

One-shot mode
Counter
Preset by resetting the timer
Repeat mode
Counter
Preset by resetting the timer
The underflow cycle can be calculated as follows:
Underflow interval = ———— [s]
ct_clk: Count clock frequency [Hz]
TR:
Reload data (0–255)
10.5
Timer Reset
The timer is reset by writing 1 to PRESER/T8F_CTLx register. The reload data is preset and the counter is initial-
ized.
10.6
Timer Run/STOP Control
Make the following settings before starting the timer.
(1) Select the count clock. See Section 10.2.
(2) Set the count mode (one-shot or repeat). See Section 10.3.
(3) Calculate the initial counter value and set it to the reload data register. See Section 10.4.
(4) Reset the timer to preset the counter to the initial value. See Section 10.5.
(5) When using timer interrupts, set the interrupt level and enable interrupts for the relevant timer channel. See
Section 10.9.
To start the timer, write 1 to PRUN/T8F_CTLx register.
The timer starts counting down from the initial value or from the current counter value if no initial value was preset.
When the counter underflows, the timer outputs an underflow pulse and presets the counter to the initial value. An
interrupt request is sent simultaneously to the interrupt controller (ITC).
In one-shot mode, the timer stops counting.
In repeat mode, the timer continues counting from the reloaded initial value.
Write 0 to PRUN to stop the timer via the application program. The counter stops counting and retains the current
counter value until either the timer is reset or restarted. To restart the count from the initial value, the timer should be
reset before writing 1 to PRUN.
S1C17624/604/622/602/621 TeChniCal Manual
Timer starts
n
n-1
Timer starts
n
n-1
Figure 10.
TR + 1
Underflow cycle = ———— [Hz]
ct_clk
Seiko epson Corporation
10 Fine MODe 8-BiT TiMeRS (T8F)
Underflow
1
0
Preset automatically
Underflow
1
0
n
n-1
Preset automatically
4.1 Preset Timing
ct_clk
TR + 1
n
(n = Reload data)
Underflow
1
0
n
Preset automatically
10-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17604S1c17622S1c17602S1c17621

Table of Contents