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.

TMS320F28027: Different ADC result depending on sample rate

Part Number: TMS320F28027

Hello,

I have a power converter that operates in two different switching frequencies depending on certain conditions. To control it, I read some analog sensors with sample rates that also change with the switching frequency.

I'm using the SOCs 1-6 to acquire theses values while SOC0 is used as a dummy read according to the silicon errata. The problem I'm having is that depending on the sample rate, I observe different reading from the same sensor. For example, at lower sample rates I read 900 and 910 at higher frequencies.

I've checked the power supply and the voltage reference and they are stable in the same value in all cases. I also tries different sample windows but the difference in the readings persists.

Does anyone have a hint on what could be happening?

  • Hi Renan,

    What ADC channels are you using? Is this consistent across A and B ADC channels on the device?

    Best Regards,

    Marlyn

  • I'm using channels A1, A2, A4 and A6 and two CPU timers to control the sampling.
    The first timer is set to 25Hz and the second to 50kHz. The ADCINTs are set to the end of conversion.

    In the first mode, all 4 channels are triggered by the first timer:

    AdcRegs.ADCSOC0CTL.all = (0xD<<6) + 63 + (0x1<<11); // Dummy reading. Discarded
    AdcRegs.ADCSOC1CTL.all = (0x4<<6) + 63 + (0x1<<11); // Sensor 1 - Timer 0
    AdcRegs.ADCSOC2CTL.all = (0x6<<6) + 63 + (0x1<<11); // Sensor 2 - Timer 0
    AdcRegs.ADCSOC3CTL.all = (0x1<<6) + 63 + (0x1<<11); // Sensor 3 - Timer 0
    AdcRegs.ADCSOC4CTL.all = (0x2<<6) + 63 + (0x1<<11); // Sensor 4 - Timer 0

    In the second mode, one channel is triggered by the second timer and the rest by the first one:

    AdcRegs.ADCSOC0CTL.all = (0xD<<6) + 63 + (0x2<<11); // Dummy reading. Discarded
    AdcRegs.ADCSOC1CTL.all = (0x6<<6) + 63 + (0x2<<11); // Sensor 1 - Timer 1
    AdcRegs.ADCSOC2CTL.all = (0xD<<6) + 63 + (0x2<<11); // Dummy reading. Discarded
    AdcRegs.ADCSOC3CTL.all = (0x4<<6) + 63 + (0x2<<11); // Sensor 2 - Timer 1
    AdcRegs.ADCSOC4CTL.all = (0x1<<6) + 63 + (0x1<<11); // Sensor 3 - Timer 1
    AdcRegs.ADCSOC5CTL.all = (0x2<<6) + 63 + (0x1<<11); // Sensor 4 - Timer 1

    Apparently the problem is not related to the channel itself. If I change the order of the channels in the SOCs configuration, the problem migrates to other channels.
    I noted that usually the first sensor read after the dummy sampling gets affected and the others not, but sometimes, depending on the parameters, other sensors are also affected.
    If I change the sample window as the sample frequency changes, I can reduce or increase the difference between the two results, but never make them equal.

    I've tried to remove this dummy sampling or have it sample the same channel as the first real sensor, but got the same results.

  • Hi Renan,

    For debugging purposes, if you configure both timers to 25Hz or 50kHz do you get matching results?

    Also, are you using overlap mode or non-overlap mode? 

    Best Regards,

    Marlyn