16 16-BIT AUDIO PWM TIMER (T16P)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
16-9
T16P Interrupts and DMA
16.5
This section describes the T16P interrupts and invoking DMA.
For more information on interrupt processing and DMA transfer, see the “Interrupt Controller (ITC)” chapter and
the “DMA Controller (DMAC)” chapter, respectively.
Interrupts
16.5.1
The T16P module can generate the following three kinds of interrupts:
• Buffer empty interrupt
• A match interrupt
• B match interrupt
T16P outputs a single interrupt signal shared by the above interrupt causes to the interrupt controller (ITC). Read
the interrupt flags in the T16P module to identify the interrupt cause that has been occurred.
Buffer empty interrupt
This interrupt request is generated when compare A buffer data are loaded into the compare A registers. It sets
the interrupt flag BUFEF/T16P_INT register in the T16P module to 1. The flag is reset by writing 1. Note,
however, that the flag will be set to 1 again after resetting if the compare A buffer is still empty. Therefore,
write compare data to the compare A buffer before resetting BUFEF.
To use this interrupt, set INTBEEN/T16P_INT register to 1. If INTBEEN is set to 0 (default), interrupt requests
for this cause is not sent to the ITC.
Note: Resetting the T16P (writing 1 to PRESET) 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.
A match interrupt
This interrupt request is generated when the counter reaches the compare A register value during counting. It
sets the interrupt flag INTAF/T16P_INT register in the T16P module to 1.
To use this interrupt, set INTAEN/T16P_INT register to 1. If INTAEN is set to 0 (default), interrupt requests for
this cause is not sent to the ITC.
When a split mode or 8-bit PCM data resolution is selected, INTAF will not be set and A match interrupts will
not be occurred.
B match interrupt
This interrupt request is generated when the counter reaches the compare B register value during counting. It
sets the interrupt flag INTBF/T16P_INT register in the T16P module to 1.
To use this interrupt, set INTBEN/T16P_INT register to 1. If INTBEN is set to 0 (default), interrupt requests
for this cause is not sent to the ITC.
If the interrupt flag is set to 1 when the interrupt has been enabled, the T16P module outputs an interrupt request to
the ITC. An interrupt is generated if the ITC and C33 PE Core interrupt conditions are satisfied.
For more information on interrupt control registers and the operation when an interrupt occurs, see the “Interrupt
Controller (ITC)” chapter.
Notes: • Reset the interrupt flag before enabling interrupts with the interrupt enable bit to prevent oc-
currence of unwanted interrupt. The interrupt flag is reset by writing 1.
• After an interrupt occurs, the interrupt flag in the T16P module must be reset in the interrupt
handler routine.