# Vault 7: Projects

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

### Protego

# PIC24FJ32MC10X -- 10-Bit ADC

- 1
- 2
…
- 29
- 30
- 31
- 32
- 33
…
- 57
- 58

© 2010 Microchip Technology Inc. Preliminary DS39737A-page 49-31
Section 49. 10-Bit ADC with 4 Simultaneous Conversions
10-Bit ADC with
4 Simultaneous
Conversions
49
Figure 49-16: Scan Four Analog Inputs Using CH0
Example 49-7 shows the code sequence to scan two analog inputs using CH0 in a 2-channel
alternate input selection configuration. Figure 49-17 illustrates the ADC operation sequence.
Example 49-7: Code Sequence for Channel Scan with Alternate Input Selection (Devices without DMA)
Sample
(AN2)
CH0
Convert
(AN2)
SOC
Trigger
Sample
(AN3)
Convert
(AN3)
Sample
(AN4)
Convert
(AN4)
Sample
(AN5)
Convert
(AN5)
ADC
Interrupt
AD1CON2bits.CHPS = 1; // Select 2-channel mode
AD1CON1bits.SIMSAM = 0; // Enable Sequential Sampling
AD1CON2bits.ALTS = 1; // Enable Alternate Input Selection
AD1CON2bits.CSCNA = 1; // Enable Channel Scanning
AD1CON2bits.SMPI = 7; // Select 8 conversion between interrupt
AD1CON1bits.ASAM = 1; // Enable Automatic Sampling
// Initialize Channel Scan Selection
AD1CSSLbits.CSS2 = 1; // Enable AN2 for scan
AD1CSSLbits.CSS3 = 1; // Enable AN3 for scan
// Initialize MUXA Input Selection
AD1CHS123bits.CH123SA = 0; // Select AN0 for CH1 +ve input
AD1CHS123bits.CH123NA = 0; // Select AV
SS for CH1 -ve inputs
// Initialize MUXB Input Selection
AD1CHS0bits.CH0SB = 4; // Select AN4 for CH0 +ve input
AD1CHS0bits.CH0NB = 0; // Select AV
SS for CH0 -ve inputs
AD1CHS123bits.CH123SB = 1; // Select AN3 for CH1 +ve input
AD1CHS123bits.CH123NB = 0; // Select AV
SS for CH1 -ve inputs

- 1
- 2
…
- 29
- 30
- 31
- 32
- 33
…
- 57
- 58