Counter Underflow; Operations In Repeat Mode; Operations In One-Shot Mode - Epson S1C31D50 Technical Manual

Cmos 32-bit single chip
Hide thumbs Also See for S1C31D50:
Table of Contents

Advertisement

6. Set the following T16_nCTL register bits:
- Set the T16_nCTL.PRESET bit to 1. (Preset reload data to counter)
- Set the T16_nCTL.PRUN bit to 1.

12.4.2 Counter Underflow

Normally, the T16 counter starts counting down from the reload data value preset and generates an underflow signal
when an underflow occurs. This signal is used to generate an interrupt and may be output to a specific peripheral
circuit as a clock (T16 Ch.n must be set to repeat mode to generate a clock). The underflow cycle is determined by
the T16 Ch.n operating clock setting and reload data (counter initial value) set in the T16_nTR register.
The following shows the equations to calculate the underflow cycle and frequency:
TR + 1
T = —————
f
CLK_T16_n
Where
T:
Underflow cycle [s]
f
:
Underflow frequency [Hz]
T
TR:
T16_nTR register setting
f
: T16 Ch.n operating clock frequency [Hz]
CLK_T16_n

12.4.3 Operations in Repeat Mode

T16 Ch.n enters repeat mode by setting the T16_nMOD.TRMD bit to 0.
In repeat mode, the count operation starts by writing 1 to the T16_nCTL.PRUN bit and continues until 0 is written.
A counter underflow presets the T16_nTR register value to the counter, so underflow occurs periodically. Select
this mode to generate periodic underflow interrupts or when using the timer to output a trigger/clock to the periph-
eral circuit.
0xffff
Counter
0x0000
Software control
PRESET = 1
Underflow interrupt

12.4.4 Operations in One-shot Mode

T16 Ch.n enters one-shot mode by setting the T16_nMOD.TRMD bit to 1.
In one-shot mode, the count operation starts by writing 1 to the T16_nCTL.PRUN bit and stops after the T16_nTR
register value is preset to the counter when an underflow has occurred. At the same time the counter stops, the T16_
nCTL.PRUN bit is cleared automatically. Select this mode to stop the counter after an interrupt has occurred once,
such as for checking a specific lapse of time.
S1C31D50/D51 TECHNICAL MANUAL
(Rev. 2.00)
(Start counting)
f
= —————
T
Underflow cycle
PRUN = 1
Figure 12.4.3.1 Count Operations in Repeat Mode
Seiko Epson Corporation
f
CLK_T16_n
(Eq. 12.1)
TR + 1
PRUN = 0
PRUN = 1
12 16-BIT TIMERS (T16)
T16_nTR
register setting
Time
12-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c31d51

Table of Contents