MAX32665-MAX32668 User Guide
Maxim Integrated Page 250 of 457
11.5 Power-Up Sequence
Complete the following steps to configure the ADC:
1. Disable the ADC clock by setting ADC_CTRL.clk_en to 0.
2. Set the ADC clock (adcclk) using GCR_PCLK_DIV.adcfrq. See Clock Configuration
3. Enable the ADC clock by setting ADC_CTRL.clk_en to 1
4. Clear the ADC reference ready interrupt flag by writing a 1 to ADC_INTR.ref_ready_if.
5. Optionally enable the ADC reference ready interrupt (ADC_INTR.ref_ready_ie = 1), and enable the ADC interrupt
vector (ADC IRQ).
6. Select one of the following ADC reference sources:
a. Internal 1.22V bandgap reference (ADC_CTRL.ref_sel = 0).
b. V
DDA
reference (ADC_CTRL.ref_sel = 1).
7. Complete the following steps to enable power:
a. Set ADC_CTRL.pwr to 1 to turn on the ADC.
b. Set ADC_CTRL.refbuf_pwr to 1 to turn on the internal reference buffer If using the internal bandgap reference.
c. Set ADC_CTRL.chargepump_pwr to 1 to turn on the ADC charge pump. Note: The ADC charge pump takes
approximately 10µs to fully charge and stabilize.
d. Wait until hardware sets the ADC_INTR.ref_ready_if bit to 1 indicating the charge pump is fully stabilized.
e. Clear the ADC reference ready interrupt flag by writing 1 to ADC_INTR.ref_ready_if.
f. Optionally disable the ADC reference ready interrupt (ADC_INTR.ref_ready_ie = 0).
11.6 Conversion
After the power-up sequence is complete, the ADC is ready for data conversion. Complete the following steps to perform a
data conversion.
1. Select the ADC input channel for the conversion by setting ADC_CTRL.ch_sel field. See ADC Channel Select for
details.
2. Optionally set input and reference scaling. See Reference Scaling and Input Scaling for details on each input
channel’s scale requirements.
3. Set the data alignment for the conversion output data using the ADC_CTRL.data_align field, 0 for LSB alignment or
1 for MSB alignment. See Table 11-4 for alignment details of the DATA register.
4. Clear the ADC done interrupt flag by writing 1 to the ADC_INTR.done_if.
5. Optionally enable the ADC done interrupt (ADC_INTR.done_ie = 1), and enable the ADC interrupt vector (ADC IRQ).
See the Interrupt chapter for details.
6. Start the ADC conversion by setting ADC_CTRL.start to 1.
7. Poll the ADC_INTR.done_if flag until you read 1, or wait for the ADC interrupt to occur if enabled in step 5.
8. Read the data from the ADC_DATA.data, and clear the ADC done interrupt flag by writing 1 to ADC_INTR.done_if.
11.7 Reference Scaling and Input Scaling
For small signals, the ADC input, ADC reference or both can be scaled by 50%. This enables flexibility to achieve better
resolution on the ADC conversion. Each input channel, supports the default of no scaling of the input
(ADC_CTRL.input_scale = 0) and no scaling of the reference (ADC_CTRL.ref_scale = 0). The following sections describe the
scale options for each of the ADC input channels.