VII PERIPHERAL MODULES 5 (ANALOG): A/D CONVERTER (ADC)
S1C33E07 TECHNICAL MANUAL
EPSON
VII-1-13
VII
ADC
VII.1.6 A/D Converter Interrupt and DMA
Upon completion of A/D conversion in each channel, the A/D converter generates an interrupt and invokes the
IDMA if necessary. In the advanced mode, the A/D converter can generate an interrupt when the conversion results
are out of the range specified with the upper-limit and lower-limit registers.
Control registers of the interrupt controller
The following shows the interrupt control bits available for the A/D converter:
FADE: A/D Conversion Completion Interrupt Cause Flag in the Port Input 4–7, RTC, A/D Interrupt Cause
Flag Register (D1/0x300287)
FADC: A/D Out-of-Range Interrupt Cause Flag in the Port Input 4–7, RTC, A/D Interrupt Cause Flag
Register (D0/0x300287)
EADE: A/D Conversion Completion Interrupt Enable Bit in the Port Input 4–7, RTC, A/D Interrupt Enable
Register (D1/0x300277)
EADC: A/D Out-of-Range Interrupt Enable Bit in the Port Input 4–7, RTC, A/D Interrupt Enable Register
(D0/0x300277)
PAD[2:0]: A/D Interrupt Level Bits in the Serial I/F Ch.1, A/D Interrupt Priority Register (D[6:4]/0x30026A)
The A/D converter sets the cause-of-interrupt flag FADE (D1/0x300287) to 1 when A/D conversion in one
channel is completed, and the conversion results are stored in ADD[9:0] and ADxBUF[9:0] (advanced mode).
ADxBUF[9:0]: A/D Ch.x Converted Data Bits in the A/D Ch.x Conversion Result Buffer Register
(D[9:0]/0x300548 + 2x)
ADD[9:0]: A/D Converted Data Bits in the A/D Conversion Result Register (D[9:0]/0x300540)
If the out-of-range interrupt is enabled in the advanced mode, the cause-of-interrupt flag FADC (D0/0x300287)
is set to 1 when the conversion results in the specified channel are out of range. Also the same cause-of-interrupt
flag FADE (D1/0x300287) as the conversion-complete interrupt is set to 1 when INTMODE (D6/0x300544)
has been set to 0.
At this time, if the interrupt enable register bit has been set to 1, an interrupt request is generated. Interrupts
can be disabled by leaving the interrupt enable register bit set to 0. The cause-of-interrupt flag is set to 1 upon
completion of A/D conversion in each channel, regardless of the setting of the interrupt enable register (even
when it is set to 0). The interrupt priority register sets the priority level (0 to 7) of an interrupt. An interrupt
request to the CPU is accepted no other interrupt request of a higher priority has been generated. In addition,
it is only when the PSR's IE bit = 1 (interrupts enabled) and the set value of the IL is smaller than the A/
D-converter interrupt level set by the interrupt priority register, that the A/D converter's interrupt request is
actually accepted by the CPU. For details on these interrupt control registers, as well as the device operation
when an interrupt has occurred, refer to Section III.2, “Interrupt Controller (ITC).”
Intelligent DMA
The A/D converter can invoke the intelligent DMA (IDMA) through the use of its cause of interrupt when an
A/D conversion has completed. This allows the conversion results to be transferred to a specified memory
location with no need to execute an interrupt processing routine. The IDMA channel number assigned to the
A/D converter is 0x1B.
Before IDMA can be invoked, the IDMA request bit RADE (D2/0x300293) and the IDMA enable bit DEADE
(D2/0x300297) must be set to 1. Transfer conditions on the IDMA side must also be set in advance.
RADE: A/D Conversion Completion IDMA Request Bit in the Serial I/F Ch.1, A/D, Port Input 4–7 IDMA
Request Register (D2/0x300293)
DEADE: A/D Conversion Completion IDMA Enable Bit in the Serial I/F Ch.1, A/D, Port Input 4–7 IDMA
Enable Register (D2/0x300297)
If a cause of interrupt occurs when the IDMA request and IDMA enable bits are set to 1, IDMA is invoked.
No interrupt request is generated at that point. An interrupt request is generated upon completion of the DMA
transfer. Otherwise, the bit can be set so as not to generate an interrupt, with only a DMA transfer performed.
For details on DMA transfers and how to control interrupts upon completion of a DMA transfer, refer to
Section II.2, “Intelligent DMA (IDMA).”