// To powerup the ADC the ADCENCLK bit should be set first to enable
// clocks, followed by powering up the bandgap and reference circuitry.
// After a 5ms delay the rest of the ADC can be powered up. After ADC
// powerup, another 20us delay is required before performing the first
// ADC conversion. Please note that for the delay function below to
// operate correctly the CPU_CLOCK_SPEED define statement in the
// DSP28_Examples.h file must contain the correct CPU clock period in
// nanoseconds. For example:
AdcRegs.ADCTRL3.all = 0x0100; // Set bit 8 high to enable external设置ADC外部的参考基准。
// ADCREFP/REFM sourcing
// See Note 1.
asm("RPT #10 || NOP"); // Time to enable of external ref asm(” rpt #10 || nop”);
AdcRegs.ADCTRL3.bit.ADCBGRFDN = 0x3; // Power up bandgap/reference circuits
DELAY_US(ADC_usDELAY); // Delay before powering up ADC
// See Note 2.
AdcRegs.ADCTRL3.bit.ADCPWDN = 1; // Power up rest of ADC
DELAY_US(ADC_usDELAY2); // Delay after powering up ADC
AdcRegs.ADCTRL1.bit.SUSMOD = 3;
//AdcRegs。ADCTRL1.bit.SUSMOD