This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/LAUNCHXL-F280049C: F280049C

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

I have a new project and am working with a F280049C launch pad.  I am also new to the C2000 micro controller.  I have a problem with the ADC measurements.  It always returns a 4095 as the raw ADC value (from this function - ADC_readResult(ADCBRESULT_BASE, ADC_SOC_NUMBER0);).  This is what I get when I measure a sequence of channels and from the on board temperature sensor.

My code is a bit based on the adc_ex3_temp_sensor example located in the C2000 ware folder on my system (C:\ti\C2000Ware_2_00_00_02_Software\driverlib\f28004x\examples\adc).  This example also gives the same value each time I run it. I have looked at all my code but not found the reason for this.

The initialisation code for the temperature measurement is below:

/**< adc measurements device temperature */

SysCtl_resetPeripheral(SYSCTL_PERIPH_RES_ADCB);
ADC_disableConverter(ADCB_BASE);

/**< Interrupts that are used in this example are re-mapped to ISR functions found within this file. */
Interrupt_register(INT_ADCB1, &adcBISR);

/**< Setup VREF as internal */
ADC_setVREF(ADCB_BASE, ADC_REFERENCE_EXTERNAL, ADC_REFERENCE_3_3V);

/**< Set ADCCLK divider to /4 */
ADC_setPrescaler(ADCB_BASE, ADC_CLK_DIV_4_0);

/**< Set pulse positions to late */
ADC_setInterruptPulseMode(ADCB_BASE, ADC_PULSE_END_OF_CONV);

/**< Power up the ADCs and then delay for 1 ms */
ADC_enableConverter(ADCB_BASE);

DEVICE_DELAY_US(1000);

/**< Configure SOCs of ADCB */
/**< SOC0 will convert pin C0, C1, C2, C3 with a sample window of 10 SYSCLK cycles. */
ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN14, 45);

/**< Set SOC1 to set the interrupt 1 flag. Enable the interrupt and make */
/**< sure its flag is cleared. */
ADC_setInterruptSource(ADCB_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER0);
ADC_enableInterrupt(ADCB_BASE, ADC_INT_NUMBER1);
ADC_clearInterruptStatus(ADCB_BASE, ADC_INT_NUMBER1);
ADC_enableContinuousMode(ADCB_BASE, ADC_INT_NUMBER1);

//
// Enable the temperature sensor and give it 500 us to power up
//
ASysCtl_enableTemperatureSensor();
DEVICE_DELAY_US(500);

Interrupt_enable(INT_ADCB1);
ADC_setInterruptSOCTrigger(ADCB_BASE, ADC_SOC_NUMBER14, ADC_INT_SOC_TRIGGER_NONE);
ADC_forceSOC(ADCB_BASE, ADC_SOC_NUMBER0);

The initialization code for the measurement of sequence of ADC channels is below:

/**< adc measurements of voltages and currents on module c */

SysCtl_resetPeripheral(SYSCTL_PERIPH_RES_ADCC);

ADC_disableConverter(ADCC_BASE);

/**< Setup VREF as internal */
ADC_setVREF(ADCC_BASE, ADC_REFERENCE_INTERNAL, ADC_REFERENCE_3_3V);

/**< Set ADCCLK divider to /4 */
ADC_setPrescaler(ADCC_BASE, ADC_CLK_DIV_4_0);

/**< Set pulse positions to late */
ADC_setInterruptPulseMode(ADCC_BASE, ADC_PULSE_END_OF_CONV);

/**< Configure SOCs of ADCA */
/**< SOC0 will convert pin C0, C1, C2, C3, C4, C5 with a sample window of 10 SYSCLK cycles. */
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN0, 10);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER1, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN1, 10);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER2, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN2, 10);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER3, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN3, 10);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER4, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN4, 10);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER5, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN5, 10);

ADC_setSOCPriority(ADCC_BASE, ADC_PRI_ALL_ROUND_ROBIN);

/**< Set SOC1 to set the interrupt 1 flag. Enable the interrupt and make */
/**< sure its flag is cleared. */
ADC_enableContinuousMode(ADCC_BASE, ADC_INT_NUMBER1);
ADC_setInterruptSource(ADCC_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER5);
ADC_clearInterruptStatus(ADCC_BASE, ADC_INT_NUMBER1);
ADC_enableInterrupt(ADCC_BASE, ADC_INT_NUMBER1);

/**< Interrupts that are used in this example are re-mapped to ISR functions found within this file. */
Interrupt_register(INT_ADCC1, &adcCISR);
Interrupt_enable(INT_ADCC1);

ADC_setInterruptSOCTrigger(ADCC_BASE, ADC_SOC_NUMBER5, ADC_INT_SOC_TRIGGER_NONE);

/**< Power up the ADCs and then delay for 1 ms */
ADC_enableConverter(ADCC_BASE);

DEVICE_DELAY_US(1000);

ADC_forceSOC(ADCC_BASE, ADC_SOC_NUMBER0);
ADC_forceSOC(ADCC_BASE, ADC_SOC_NUMBER1);
ADC_forceSOC(ADCC_BASE, ADC_SOC_NUMBER2);
ADC_forceSOC(ADCC_BASE, ADC_SOC_NUMBER3);
ADC_forceSOC(ADCC_BASE, ADC_SOC_NUMBER4);
ADC_forceSOC(ADCC_BASE, ADC_SOC_NUMBER5);

I am yet to connect my hardware to the launchpad.

Please what can be the problem and what is the solution.

Thanks