25 A/D CONVERTER (ADC10)
25-8
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
A/D Converter Interrupts and DMA
25.5
The A/D converter includes a function for generating the following two different types of interrupts.
• Conversion completion interrupt
• Conversion data overwrite error interrupt
The A/D converter outputs one interrupt signal shared by the two above interrupt causes to the interrupt controller
(ITC). Inspect the status flag to determine the interrupt cause occurred.
Conversion completion interrupt
To use this interrupt, set ADCIE/ADC10_CTL register to 1. If ADCIE is set to 0 (default), interrupt requests for
this cause will not be sent to the ITC.
When A/D conversion in a channel has completed, the A/D converter sets ADCF/ADC10_CTL register to 1,
indicating that the converted data can be read out. If conversion completion interrupts are enabled (ADCIE = 1),
an interrupt request is sent simultaneously to the ITC.
An interrupt occurs if other interrupt conditions are met.
You can inspect ADCF in the ADC10 interrupt handler routine to determine whether the ADC10 interrupt is
attributable to a completion of conversion. If ADCF is 1, the converted data can be read out from ADD[15:0]/
ADC10_ADD register by the interrupt handler routine. The interrupt cause ADCF is reset to 0 by reading
ADD[15:0] and this interrupt will not be generated until the subsequent conversion has completed.
Conversion data overwrite error interrupt
To use this interrupt, set ADOIE/ADC10_CTL register to 1. If ADOIE is set to 0 (default), interrupt requests
for this cause will not be sent to the ITC.
If the following A/D conversion has completed when ADD[15:0] has not been read (ADCF = 1), the A/D con-
verter sets ADOWE/ADC10_CTL register to 1, indicating that ADD[15:0] is overwritten. If conversion data
overwrite error interrupts are enabled (ADOIE = 1), an interrupt request is sent simultaneously to the ITC.
An interrupt occurs if other interrupt conditions are met.
You can inspect ADOWE in the ADC10 interrupt handler routine to determine whether the ADC10 interrupt is
attributable to an overwrite error. If ADOWE is 1, perform error handling by the interrupt handler routine. The
interrupt cause ADOWE is reset to 0 by writing 1.
For more information on interrupt processing, see the “Interrupt Controller (ITC)” chapter.
DMA Transfer
The A/D converter can invoke a DMA when A/D conversion in a channel has completed. This allows continu-
ous data transfer via the DMAC between memory and the conversion result register (ADC10_ADD).Two
DMAC channels (Ch.0 and Ch.7) are available for A/D converter. For more information on DMA transfer, see
the “DMA Controller (DMAC)” chapter.
Control Register Details
25.6
6.1 List of A/D Converter Registers
Table 25.
Address
Register name
Function
0x301300
ADC10_ADD
A/D Conversion Result Register
A/D converted data
0x301302
ADC10_TRG
A/D Trigger/Channel Select Register
Sets start/end channels and conversion mode.
0x301304
ADC10_CTL
A/D Control/Status Register
Controls A/D converter and indicates conversion status.
0x301306
ADC10_CLK
A/D Clock Control Register
Controls A/D converter clock.
The A/D converter registers are described in detail below. These are 16-bit registers.
Note: When data is written to the registers, the “Reserved” bits must always be written as 0 and not 1.