16 16-BIT AUDIO PWM TIMER (T16P)
16-14
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
D3
CLKSEL: Input Clock Select Bit
Selects the input clock for the T16P.
1 (R/W): External clock
0 (R/W): Internal clock (default)
When CLKSEL is set to 0, the internal clock (prescaler output) is selected for the count clock. When
CLKSEL is set to 1, an external clock (one that is fed from the PWM_EXCL pin) is selected. When us-
ing an external clock, the external clock cycle must be at least two CPU operating clock cycles.
D2
Reserved
D1
PRESET: T16P Reset Bit
Resets T16P.
1 (W):
Reset
0 (W):
Has no effect
0 (R):
Always 0 when read (default)
The following operations are performed when PRESET is set to 1.
• The counter (CNT_DATA[15:0]/T16P_CNT_DATA register) is reset to 0x0.
• The B match counter is reset to 0x0.
• The initial volume level (VOLSEL[6:0]/T16P_VOL_CTL register) is loaded into the volume control
circuit.
• The compare A and B buffers/registers (CMPA[15:0]/T16P_A register, CMPB[15:0]/T16P_B
register) are reset to 0x0.
• The buffer empty flag (BUFEF/T16P_INT register) is set to 1. (No interrupt occurs.)
• All other interrupt flags are reset to 0 and interrupt requests are canceled.
• DMA request is canceled if it has been issued.
• The PWM outputs go to the initial output level set by INITOL.
Note: Be sure to reset T16P before the GPIO pins are switched to the PWM_H and PWM_L pins,
and before setting PRUN/T16P_RUN register to 1 to start T16P.
D0
Reserved
T16P Running Control Register (T16P_RUN)
Register name Address
Bit
Name
Function
Setting
Init. R/W
Remarks
T16P Running
Control Register
(T16P_RUN)
0x30120a
(16 bits)
D15–1 –
reserved
–
–
–
0 when being read.
D0
PRUN
T16P run/stop control
1 Run
0 Stop
0
R/W
D[15:1] Reserved
D0
PRUN: T16P Run/Stop Control Bit
Starts and stops T16P.
1 (R/W): Run
0 (R/W): Stop (default)
To start T16P, write 1 to PRUN.
T16P must be reset (write 1 to PRESET/T16P_CTL register) before writing 1 to PRUN. Resetting the
T16P sets the buffer empty flag to 1, but neither an interrupt request nor a DMA request is issued at
this point even if the buffer empty interrupt is enabled. Writing 1 to PRUN enables T16P to issue buffer
empty interrupts and DMA requests, so that the first audio data can be sent to the buffer in the interrupt
handler routine or DMA.
To stop T16P being run, write 0 to PRUN. The compare data buffers/registers and counter retain the
value at stop. The PWM output is fixed at the level set by INITOL. Note that T16P may not stop count-
ing until B match conditions occur (BCNT[3:0] + 1) times.