
iVPeRiPheRaLMoDuLes2(tiMeRs):16-bittiMeRs(t16)
iV-1-8
ePson
s1C33L17teChniCaLManuaL
Da16function(advancedmode)
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 0 and timer 3
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.
Timer1
Timer2
CR1A[9:0]
16-bitdatawrite
or
ComparisondataAregister
ComparisondataAregisterbuffer
DA16Ch.0register
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
ComparisondataAregister
ComparisondataAregisterbuffer
Comparator
FigureIV.1.5.1DA16Function(Ch.0)
Resettingthecounter
Each timer includes PRESETx (D1/0x300786 + 8x) to reset the counter.
PResetx:16-bitTimerxResetBitinthe16-bitTimerxControlRegister(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.
timerRun/stoPcontrol
Each timer includes PRUNx (D0/0x300786 + 8x) to control RUN/STOP.
PRunx:16-bitTimerxRun/StopControlBitinthe16-bitTimerxControlRegister(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.