1.1.1 ADC Conversion May Not Complete
- When FOSC is greater than 8 MHz and it is the clock source used for the ADC converter.
-
The ADC is operating from its dedicated ADCRC oscillator and the device is not in Sleep mode (at any FOSC frequency). When this occurs, the ADC Interrupt Flag (ADIF) does not get set, the GO/DONE bit does not get cleared, and the conversion result does not get loaded into the ADRESH and ADRESL result registers.
Work around
Method 1:
Select the system clock, FOSC, as the ADC clock source and reduce the FOSC frequency to 8 MHz or less when performing ADC conversions.
Method 2:
Select the dedicated ADCRC oscillator as the ADC conversion clock source and perform
all conversions with the device in SLEEP
Method 3:
This method is provided if the application cannot use Sleep mode and requires continuous operation at frequencies above 8 MHz. This method requires early termination of an ADC conversion. Provide a fixed time delay in software to stop the ADC conversion manually, after all 10 bits are converted, but before the conversion would complete automatically. The conversion is stopped by clearing the GO/DONE bit in software, and must be cleared during the last ½ TAD cycle, before the conversion would have completed automatically.
In Figure 1-1, 88 instruction cycles will be required to complete the full conversion. Each TAD cycle consists of 8 TCY periods. A fixed delay is provided to stop the A/D conversion after 86 instruction cycles and terminate the conversion at the correct time.
TAD | Instruction Cycle Delay Counts by TAD Selection |
---|---|
FOSC/64 | 172 |
FOSC/32 | 86 |
FOSC/16 | 43 |
Code Example of Instruction Cycle Delay
BSF ADCON0, ADGO ; Start ADC Conversion
; Provide 86 instruction cycle delay here
BCF ADCON0, ADGO ; Terminate the conversion manually
MOVF ADRESH, W ; Read the conversion result
Affected Silicon Revisions
A1 | A2 | A3 | |||||
X |