I'm utilizing F28335 with the board 28335eZdspUSB (spectrum digital). I want to use the external voltage reference (2.048V). ADC module is initialized first select external reference source then power up bandgap circuitry and ADC adc power main but the conversion results are bad. Results are lower than expected, it looks like reference was internal bandgap (3V). If I call ADC_cal() subroutine, is there any problem with the external reference and convertion results? Anybody can help me? Here is my init code:
/*** Reset the ADC module ***/
AdcRegs.ADCTRL1.bit.RESET = 1; // Reset the ADC module
asm(" RPT #10 || NOP"); // Must wait 12-cycles (worst-case) for ADC reset to take effect
AdcRegs.ADCREFSEL.bit.REF_SEL=0x1; // External Ref. 2.048V on ADCREFIN
/*** Must follow the proper ADC power-up sequence ***/
AdcRegs.ADCTRL3.all = 0x00D1; // first power-up ref and bandgap circuits
/*
bit 15-8 0's: reserved
bit 7 1: ADCRFDN, reference power, 1=power on
bit 6 1: ADCBGDN, bandgap power, 1=power on
bit 5 0: ADCPWDN, main ADC power, 1=power on
bit 4-1 1101: ADCCLKPS, clock prescaler, ADCLK=HSPCLK/(16*ADQ_CPS)
bit 0 1: SMODE_SEL, 0=sequential sampling, 1=simultaneous sampling
*/
DELAY_US(5000); // Wait 5ms before setting ADCPWDN
AdcRegs.ADCTRL3.bit.ADCPWDN = 1; // Set ADCPWDN=1 to power main ADC
DELAY_US(20); // Wait 20us before using the ADC
/*** Configure the other ADC register ***/
AdcRegs.ADCMAXCONV.all = 0x0007; // 8 double conv's (16 total)
Thanks