Counter Value Read; Interrupt; Control Registers; T16 Ch.n Clock Control Register - Epson S1C17M12 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

10 16-BIT TIMERS (T16)
0xffff
Counter
0x0000
Software control
PRESET = 1
Underflow interrupt

10.4.5 Counter Value Read

The counter value can be read out from the T16_nTC.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.

10.5 Interrupt

Each T16 channel has a function to generate the interrupt shown in Table 10.5.1.
Interrupt
Underflow
T16 provides interrupt enable bits corresponding to each interrupt flag. An interrupt request is sent to the interrupt
controller only when the interrupt flag, of which interrupt has been enabled by the interrupt enable bit, is set. For
more information on interrupt control, refer to the "Interrupt Controller" chapter.

10.6 Control Registers

T16 Ch.n Clock Control Register

Register name
Bit
T16_nCLK
15–9 –
8
7–4 CLKDIV[3:0]
3–2 –
1–0 CLKSRC[1:0]
Bits 15–9 Reserved
Bit 8
DBRUN
This bit sets whether the T16 Ch.n operating clock is supplied in DEBUG mode or not.
1 (R/W): Clock supplied in DEBUG mode
0 (R/W): No clock supplied in DEBUG mode
Bits 7–4
CLKDIV[3:0]
These bits select the division ratio of the T16 Ch.n operating clock (counter clock).
Bits 3–2
Reserved
Bits 1–0
CLKSRC[1:0]
These bits select the clock source of T16 Ch.n.
10-4
Underflow cycle
PRUN = 1
PRUN = 1
Figure 10.4.4.1 Count Operations in One-shot Mode
Table 10.5.1 T16 Interrupt Function
Interrupt flag
T16_nINTF.UFIF
When the counter underflows
Bit name
Initial
0x00
DBRUN
0
0x0
0x0
0x0
Seiko Epson Corporation
PRUN = 1
PRUN = 1
PRUN = 0
Set condition
Reset
R/W
R
H0
R/W
H0
R/W
R
H0
R/W
S1C17M12/M13 TECHNICAL MANUAL
T16_nTR
register setting
Time
Clear condition
Writing 1
Remarks
(Rev. 1.2)

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17m13

Table of Contents