12-4
Seiko Epson Corporation
S1C31D50 TECHNICAL MANUAL
(Rev. 1.00)
12.4.4.
Operations in One-shot Mode
T16 Ch.
n
enters one-shot mode by setting the T16_
n
MOD.TRMD bit to 1.
In one-shot mode, the count operation starts by writing 1 to the T16_
n
CTL.PRUN bit and stops after the
T16_
n
TR register value is preset to the counter when an underflow has occurred. At the same time the
counter stops, the T16_
n
CTL.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.
Figure 12.4.4.1 Count Operations in One-shot Mode
12.4.5.
Counter Value Read
The counter value can be read out from the T16_
n
TC.TC[15:0] bits. However, since T16 operates on
CLK_T16_
n
, one of the operations shown below is required to read correctly by the CPU.
-
Read the counter value twice or more and check to see if the same value is read.
-
Stop the timer and then read the counter value.
12.5.
Interrupt
Each T16 channel has a function to generate the interrupt shown in Table 12.5.1.
Table 12.5.1 T16 Interrupt Function
Interrupt
Interrupt flag
Set condition
Clear condition
Underflow
T16_
n
INTF.UFIF
When the counter
underflows
Writing 1
T16 provides interrupt enable bits corresponding to each interrupt flag. An interrupt request is sent to
the CPU core only when the interrupt flag, of which interrupt has been enabled by the interrupt enable
bit, is set. For more infor
mation on interrupt control, refer to the “Interrupt” chapte
r.
PRESET = 1
PRUN = 1
PRUN = 1
PRUN = 0
PRUN = 1
PRUN = 1
0xffff
0x0000
Counter
Underflow cycle
T16_
n
TR
register setting
Time
Software control
Underflow interrupt
Summary of Contents for S1C31D50
Page 461: ...25 1 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 25 Package TQFP12 48PIN ...
Page 462: ...25 2 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP13 64PIN ...
Page 463: ...25 3 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 TQFP14 80PIN ...
Page 464: ...25 4 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP15 100PIN ...