Hi Experts,
MCU: TMS570LS20216
IDE: CCSV4
Debug: JTAG
ADC module Configure: configure adc1 group1 RAM size to 16 words, sample four channels: ADSIN[8],[9],[10],[13]. sample frequency:10KHz (conversion triggered by NHET pin), read the conversion results in adc interrupt, this interrupt happen frequency is also 10KHz.
Reading the group’s conversion results from a FIFO queue.
Test method: Use a stable power and input 3V to these four ADSIN[x] pins, then debugging, always it can get the correct conversion results, but sometimes, it will get value 0. Please help me to find why it happens? Does the sample frequency is too high? And how to solve this problem? Thanks so much.
Related Code is following:
static volatile unsigned ADC_FIFO_Buffer;
adcData_t g_ADC1_Group1_AdcResult[4];
while (((adcREG1->GxINTFLG[adcGROUP1]) & 0x08) != 0x08)
{
}
adcREG1->GxINTFLG[adcGROUP1] = 9U;
ADC_FIFO_Buffer = adcREG1->GxBUF[adcGROUP1].BUF0;
g_ADC1_Group1_AdcResult[0].value = (unsigned short)(ADC_FIFO_Buffer & 0xFFFU);
ADC_FIFO_Buffer = adcREG1->GxBUF[adcGROUP1].BUF0;
g_ADC1_Group1_AdcResult[1].value = (unsigned short)(ADC_FIFO_Buffer & 0xFFFU);
ADC_FIFO_Buffer = adcREG1->GxBUF[adcGROUP1].BUF0;
g_ADC1_Group1_AdcResult[2].value = (unsigned short)(ADC_FIFO_Buffer & 0xFFFU);
ADC_FIFO_Buffer = adcREG1->GxBUF[adcGROUP1].BUF0;
g_ADC1_Group1_AdcResult[3].value = (unsigned short)(ADC_FIFO_Buffer & 0xFFFU);