16 16-BIT AUDIO PWM TIMER (T16P)
16-2
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
T16P consists of a 16-bit up-counter and two 16-bit compare data buffers/registers.
The 16-bit counter can be reset to 0 via software and counts up using a prescaler output clock or an external clock
input from the PWM_EXCL pin.
The compare A buffer is used to store data (PCM data). The stored data is loaded to the compare A register and
compared with the counter value to determine the output pulse width. The volume control unit multiplies the PCM
data stored in the compare A buffer by the specified volume level set via software before loading to the compare A
register. This makes it possible to adjust the volume level to 1/64 through 127/64 as well as muting.
The compare B buffer is used to store data to determine a pulse period. The stored data is loaded to the compare B
register and compared with the counter value.
When the counter value reaches the compare data, the timer output signal is inverted to generate PWM waveform.
T16P Input/Output Pins
16.2
Table 16.2.1 lists the input/output pins for the T16P module.
2.1 List of T16P Pins
Table 16.
Pin name
I/O
Qty
Function
PWM_EXCL
I
1
T16P external clock input pin
Inputs an external clock as the count clock.
PWM_H
O
1
PWM signal output pin
In a split mode: Outputs the PWM signal generated from the high-order PCM
data bits.
In normal mode: Outputs the PWM signal generated from the PCM data.
PWM_L
O
1
PWM signal output pin
In a split mode: Outputs the PWM signal generated from the low-order PCM data
bits.
In normal mode: Fixed at the initial output level (or not used).
The T16P input/output pins (PWM_EXCL, PWM_H, PWM_L) are shared with I/O ports and are initially set as
general purpose I/O port pins. The pin functions must be switched using the port function select bits to use the gen-
eral purpose I/O port pins as T16P input/output pins.
For detailed information on pin function switching, see the “I/O Ports (GPIO)” chapter.
Setting T16P Operating Conditions
16.3
Make the following settings before starting T16P.
1. Select the count clock. (See Section 16.3.1.)
2. Configure the PCM data (resolution, signed/unsigned data format). (See Section 16.3.2.)
3. Select the operating modes (split mode, fine mode). (See Section 16.3.3.)
4. Set the PWM output condition (initial signal level). (See Section 16.3.4.)
5. Set the initial volume level. (See Section 16.4.4.)
6. Set interrupt and/or DMA conditions. (See Section 16.5.)
7. Reset T16P. (See Section 16.4.1.)
8. Configure the T16P input/output pins. (See Section 16.2.)
9. Start T16P. (See Section 16.4.2.)
Count Clock
16.3.1
Either an internal clock or an external clock can be selected as the count clock using CLKSEL/T16P_CTL register.
When CLKSEL is set to 0 (default), an internal clock is used; when set to 1, the external clock input to the PWM_
EXCL pin is used.
When using an external clock, the external clock cycle must be at least two CPU operating clock cycles.
When an internal clock is used, it can be selected using CLKDIV[3:0]/T16P_CLK register from the 13 types gener-
ated by the prescaler (PSC Ch.0) dividing the PCLK1 clock into 1/1 to 1/4,096.