Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
PIC24F Family Reference Manual
DS39737A-page 49-14 Preliminary © 2010 Microchip Technology Inc.
49.3.4 Automatic Sample and Manual Conversion Sequence
In the Automatic Sample and Manual Conversion Sequence, sampling starts automatically after
conversion of the previous sample. The user application must allocate sufficient time for
sampling before clearing the SAMP bit. Clearing the SAMP bit initiates the conversion (see
Figure 49-4).
Figure 49-4: Automatic Sample and Manual Conversion Sequence
Example 49-2: Code Sequence for Automatic Sample and Manual Conversion
+
-
+
-
Sample Time Conversion Time
SAMP
1
2
Sample Time
+
-
3 4
Conversion
5
Note 1: Sampling is started automatically after conversion completion of the previous sample.
2: Conversion is started by clearing the SAMP bit in software.
3: Conversion is complete.
4: Sampling is started automatically after conversion completion of the previous sample.
5: Conversion is started by clearing the SAMP bit in software.
while (1) // Repeat continuously
{
DelayNmSec(100); // Sample for 100 ms
AD1CON1bits.SAMP = 0; // Start converting
while (!AD1CON1bits.DONE); // Conversion done?
AD1CON1bits.DONE = 0; // Clear conversion done status bit
ADCValue = ADC1BUF0; // If yes, then get the ADC value
} // Repeat
Protego_Release_01_05-Related-OEM-Documentation-PIC24FJ32MC10X-Reference_Manual-Section49-10-Bit_ADC_with_4_Simultaneous_Conversions.pdf