Hello. I am trying to setup the ADC of a TMS320F28335 Experimenter's kit. I believe I setup the registers correctly but I think the hardware setup is wrong because I am not getting any digital value despite the analog voltage input. I am only using one pin (A0) for one conversion which is hooked up to a power supply; I have the power supply and the kit grounded but I feel there is something missing. The uC manual mentioned something about ADC Reference High and low pins but there are no such pins on the kit. Can any of you help me out? For your convenience I posted the bit settings of the ADC below. Thank You.
//Control Register
AdcRegs.ADCTRL3.bit.ADCBGRFDN = 3; //The Bandgap and reference circuitry is powered up
AdcRegs.ADCTRL3.bit.ADCPDN = 1; //Analog circuitry inside the core is powered up
AdcRegs.ADCTRL3.bit.ADCCLKPS = 0; // Core Clock Divider: HSPCLK/(ADCTRL1[7] +1)
AdcRegs.ADCTRL3.bit.SMODE_SEL = 0; // Sequential sampling mode is selected
//A cycle delay gets posted here
EALLOW;
SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1;
ADC_cal();
EDIS;
//Control Register 1
AdcRegs.ADCTRL1.bit.ACQ_PS = 0x0; //No Acquisition window
AdcRegs.ADCTRL1.bit.CONT_RUN = 1; // Continuous mode
AdcRegs.ADCTRL1.bit.CPS = 0; // Core clock prescaler disabled
AdcRegs.ADCTRL1.bit.SEQ_CASC = 0; //Dual-sequencer mode
AdcRegs.ADCTRL1.bit.SEQ_OVRD = 0; //Sequence over rider disabled
AdcRegs.ADCTRL1.bit.SUSMOD = 0x01; //Mode 1: Sequencer and other wrapper logic stops after current sequence is completed
//Control Register 2
AdcRegs.ADCTRL2.bit.EPWM_SOCA_SEQ1 = 0; // ePWM will not trigger start of conversion (SOC)
AdcRegs.ADCTRL2.bit.EPWM_SOCB_SEQ = 0; // ePWM will not trigger SOC
AdcRegs.ADCTRL2.bit.EPWM_SOCB_SEQ2 = 0; // ePWM will not trigger SOC
AdcRegs.ADCTRL2.bit.EXT_SOC_SEQ1 = 0; //External interrupt will not trigger SOC
AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 = 1; //Interrupt enabled for SEQ1
AdcRegs.ADCTRL2.bit.INT_MOD_SEQ1 = 0; // Interrupt is set at the end of every SEQ1 sequence
AdcRegs.ADCTRL2.bit.INT_ENA_SEQ2 = 0; // No interrupt for SEQ2
AdcRegs.ADCTRL2.bit.INT_MOD_SEQ2 = 0; // Don't care sincce interrupt is disabled
// Maximum Conversion Channels Register
AdcRegs.ADCMAXCONV.bit.all = 0x0 // 1 conversion for SEQ1
// Input Channel Select Sequencing Control Registers
AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0; //Setup ADCINA0 pin to SEQ1
AdcRegs.ADCREFSEL.bit. REF_SEL = 0; // 00 - Internal Reference selected (default)
// 01 - External Reference, 2.048 V on ADCREFIN
// 10 - External Reference, 1.500 V on ADCREFIN
// 11 - External Reference, 1.024 V on ADCREFIN