Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

© 2010 Microchip Technology Inc. Preliminary DS39737A-page 49-13
Section 49. 10-Bit ADC with 4 Simultaneous Conversions
10-Bit ADC with
4 Simultaneous
Conversions
49
Table 49-3 lists the sample conversion sequence with different sample and conversion phase
selections.
Table 49-3: Sample Conversion Sequence Selection
49.3.3 Manual Sample and Manual Conversion Sequence
In the Manual Sample and Manual Conversion Sequence, setting the Sample bit (SAMP) in the
ADC Control Register 1 (ADxCON1<1>) initiates sampling, and clearing the SAMP bit terminates
sampling and starts conversion (see Figure 49-3). The user application must time the setting and
clearing of the SAMP bit to ensure adequate sampling time for the input signal. Example 49-1
illustrates a code sequence for Manual Sample and Manual Conversion.
Figure 49-3: Manual Sample and Manual Conversion Sequence
Example 49-1: Code Sequence for Manual Sample and Manual Conversion
ASAM SSRC<2:0> Description
0 000 Manual Sample and Manual Conversion Sequence
0 111 Manual Sample and Automatic Conversion Sequence
0 001
010
011
100
Manual Sample and Triggered Conversion Sequence
1 000 Automatic Sample and Manual Conversion Sequence
1 111 Automatic Sample and Automatic Conversion Sequence
1 001
010
011
100
Automatic Sample and Triggered Conversion Sequence
Note: Due to the internal delay within the ADC module, the SAMP bit will read as ‘0’ to the user software, after a
small interval of time, after the conversion has already begun. In general, the time interval will be 2 T
CY.
+
-
+
-
Sample Time Conversion Time
SAMP
1
2
Sample Time
+
-
3 4
Conversion
5
Note 1: Sampling is started by setting the SAMP bit in software.
2: Conversion is started by clearing the SAMP bit in software.
3: Conversion is complete.
4: Sampling is started by setting the SAMP bit in software.
5: Conversion is started by clearing the SAMP bit in software.
AD1CON1bits.SAMP = 1; // Start sampling
DelayUs(10); // Wait for sampling time (10us)
AD1CON1bits.SAMP = 0; // Start the conversion
while (!AD1CON1bits.DONE); // Wait for the conversion to complete
ADCValue = ADC1BUF0; // Read the conversion result

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh