![](http://datasheet.mmic.net.cn/30000/M30956FKTGP_datasheet_2359453/M30956FKTGP_304.png)
17. A/D Converter
17.1.2
Repeat Mode
In repeat mode, analog voltage applied to a selected pin is repeatedly converted to a digital code.
Table 17.4
Repeat Mode Specifications
Item
Specification
Function
Analog voltage applied to a selected pin is repeatedly converted to a digital code
Analog voltage input pins
Select one pin from AN_0 to AN_7, AN0_0 to AN0_7, AN2_0 to AN2_7, AN15_0
to AN15_7, ANEX0, or ANEX1
The following register settings determine which pin is used:
Bits CH2 to CH0 in the AD0CON0 register
Bits OPA1 and OPA0 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
Set the ADST bit in the AD0CON0 register 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), interrupt request is not generated
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)