
17. A/D Converter
17.1.3
Single Sweep Mode
In single sweep mode, analog voltage that is applied to multiple selected pins is converted once for each pin to
a digital code.
Table 17.5 lists specifications of single sweep mode.
Table 17.5
Single Sweep Mode Specifications
Item
Specification
Function
Analog voltage applied to selected pins is converted once for each pin to a digital
code
Analog voltage input pins
Select one of the following.
2 pins (ANi_0 and ANi_1) (i = none, 0, 2, 15)
4 pins (ANi_0 to ANi_3)
6 pins (ANi_0 to ANi_5)
8 pins (ANi_0 to ANi_7)
The following register settings determine which pins are used:
Bits SCAN1 and SCAN0 in the AD0CON1 register
Bits APS1 and APS0 in the AD0CON2 register
Start condition
When the TRG bit in the AD0CON0 register is set to 0 (software trigger):
the ADST bit in the AD0CON0 register is set to 1 (A/D conversion starts)
When the TRG bit is set to 1 (external trigger, hardware trigger), one of the
following can be selected:
A falling edge is input to the ADTRG pin after the ADST bit is set to 1
Timer B2 interrupt request of three-phase motor control timer function (after
the ICTB2 register completes counting) is generated after the ADST bit is set
to 1
Stop condition
When the TRG bit is set to 0 (software trigger):
A/D conversion is completed (the ADST bit becomes 0)
When the TRG bit is set to 1 (external trigger, hardware trigger):
Set the ADST bit to 0 (A/D conversion stops)
Interrupt request generation timing When the DUS bit in the AD0CON3 register is set to 0 (DMAC operating mode
disabled), an interrupt request is generated after the sequence of A/D
conversions is completed
When the DUS bit is set to 1 (DMAC operating mode enabled), an interrupt
request is generated every time A/D conversion is completed
Reading of A/D conversion result
When the DUS bit in the AD0CON3 register is set to 0 (DMAC operating mode
disabled), read the AD0j register (j = 0 to 7) corresponding to a selected pin by
program.
When the DUS bit in the AD0CON3 register is set to 1 (DMAC operating mode
enabled), A/D conversion result is stored into the AD00 register after A/D
conversion is completed. Then, DMAC transfers the data from the AD00
register to a given memory space. (Refer to 12. DMAC for DMAC settings)