
IV PERIPHERAL MODULES 2 (TIMERS): 16-BIT TIMERS (T16)
IV-1-8
EPSON
S1C33E07 TECHNICAL MANUAL
DA16 function (advanced mode)
Advanced mode supports the DA16 function that divides a 16-bit data into 10 high-order bits and 6 low-order
bits and writes them to the comparison data A registers (or buffers) of a two timer pair simultaneously. This
makes it possible to reduce software load for using two 16-bit timers as a 16-bit D/A converter.
Three DA16 registers are provided for this function. The following shows the correspondence between these
registers and timers:
(timer A and timer B)
DA16 Ch.0 Register (0x3007D0): timer 1 and timer 2
DA16 Ch.1 Register (0x3007D2): timer 3 and timer 4
DA16 Ch.2 Register (0x3007D4): timer 5 and timer 0
When data is written to this register, 10 high-order bits are loaded into the Timer A Comparison Data A
Setup Register (buffer) as 10 low-order compare data bits and 6 low-order bits are loaded into the Timer B
Comparison Data A Setup Register (buffer) as 6 low-order compare data bits.
In standard mode, data cannot be written to the DA16 registers.
Timer 1
Timer 2
CR1A[9:0]
16-bit data write
or
Comparison data A register
Comparison data A register buffer
DA16 Ch.0 register
DA0A[15:6]
CR2A[5:0]
(CR1A[15:10] = 0) (CR2A[15:6] = 0)
DA0A[5:0]
(SELCRB1 = 1)
(SELCRB1 = 0)
(SELCRB2 = 1)
(SELCRB2 = 0)
Comparator
Comparison data A register
Comparison data A register buffer
Comparator
Figure IV.1.5.1 DA16 Function (Ch.0)
Resetting the counter
Each timer includes PRESETx (D1/0x300786 + 8x) to reset the counter.
PRESETx: 16-bit Timer x Reset Bit in the 16-bit Timer x Control Register (D1/0x300786 + 8x)
Normally, reset the counter before starting count-up by writing 1 to this control bit.
After the counter starts counting, it will be reset by comparison match B.
Timer RUN/STOP control
Each timer includes PRUNx (D0/0x300786 + 8x) to control RUN/STOP.
PRUNx: 16-bit Timer x Run/Stop Control Bit in the 16-bit Timer x Control Register (D0/0x300786 + 8x)
The timer starts counting when 1 is written to PRUNx (D0/0x300786 + 8x). The clock input is disabled and the
timer stops counting when 0 is written to PRUNx.
This RUN/STOP control does not affect the counter data. Even when the timer has stopped counting, the
counter retains its count so that the timer can start counting again from that point.
If the count of the counter matches the set value of the comparison data register during count-up, the timer
generates a comparison match interrupt.
When the counter matches comparison data B, an interrupt is generated and the counter is reset. At the same
time, the values set in the compare register buffer are loaded to the compare data register if SELCRBx (D5/
0x300786 + 8x) is set to 1.
The counter continues counting up regardless of which interrupt has occurred. In the case of a comparison B
interrupt, the counter starts counting beginning with 0.
When both PRUNx (D0/0x300786 + 8x) and PRESETx (D1/0x300786 + 8x) are set to 1 at the same time, the
timer starts counting after resetting the counter.