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.

TMS320F28335: Issue with multiple voltages sensing using ADC

Part Number: TMS320F28335

Dear Team,

I am measuring filtered average dc voltages (float values) giving to ADC. I am sending 4 voltages to 4 ADCs (A0,B0,A1,B1). When I start all values should be same and I  am getting the same. But when I started changing one particular voltage, corresponding adc count should change but along with it the pin beside that adc pin also getting changes slowly. I don't know why other ADC reading getting effected with variation in one adc pin input.

Suppose if I am varying A0 input, A1 is drifting slowly same way B0 and B1. but not between A0 and B0 or A1 and B1. Can you please let me know what could be the reason for it. I attached a part of code which is related to ADC, please let me know if any issues with it.

Thanks,

void main(void)
{

............

AdcRegs.ADCTRL1.all = 0;
AdcRegs.ADCTRL1.bit.ACQ_PS = 0x7; // S/H width in ADC module periods = 8 ADC clocks
AdcRegs.ADCTRL1.bit.CONT_RUN = 1; // Setup continuous run
AdcRegs.ADCTRL1.bit.SEQ_CASC = 0x1; // Cascaded mode

AdcRegs.ADCTRL3.bit.ADCCLKPS = 0x1; // ADCCLK(FCLK)=HSPCLK/(2*ADCCLKPS)=25.0MHz/(1*2)=12.5MHz for ADCCLKPS = 1
AdcRegs.ADCTRL3.bit.SMODE_SEL = 0x1; //Sampling mode Simultaneous

AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0; //A0 and B0
AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 0x1; //A1 and B1

AdcRegs.ADCMAXCONV.all = 0x0001; // For 4 ADC Inputs

.................
for(;;)
{
asm(" NOP");
}

}


interrupt void cpu_timer0_isr(void)
{
......................

AdcRegs.ADCTRL2.all = 0x2000;

while (AdcRegs.ADCST.bit.INT_SEQ1== 0) {}
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;

temp = AdcRegs.ADCRESULT0 >>4 ;
v1 = temp;

temp = AdcRegs.ADCRESULT1 >>4 ;
v2 = temp;

temp = AdcRegs.ADCRESULT2 >>4;
v3 = temp;

temp = AdcRegs.ADCRESULT3 >>4;
v4 = temp;

....................................
}

  • Siva,

    Does increasing the ACQ_PS help? You may be experiencing crosstalk between channels that share the same sample and hold capacitor.

    Here are some similar threads:
    e2e.ti.com/.../647338
    e2e.ti.com/.../542665

    -Tommy
  • Dear Tommy,

    I tried changing acq_ps it doesn't help. Actually after 3.3v to 0v varying square wave signal I am putting low pass filter to get average DC value and giving it to adc.

    1. Low pass filter values are c=150pf,R=565k. Is it any issue with thease values then what could be the solution?

    2. Can I give 3.3v square wave signal directly to adc so that low pass filter won't come into picture and I can implement digital low pass filter in dsp. Or can you tell me what interface can be done between 3.3v to 0v varying square signal to adc pin so that it won't get affected?

    Thanks,

  • siva swami said:
    1. Low pass filter values are c=150pf,R=565k. Is it any issue with thease values then what could be the solution?

    The input R is quite large and will slow down the rate at which the internal ADC S/H capacitor will charge.  I suspect that you may even be able to see distortion on the ADC input pin using a scope.  You can counter this by using a smaller R and larger C (while maintaining your desired RC) so that the external filtering capacitor will be able to charge the internal ADC S/H capacitor quickly through charge sharing.  The second link that I posted previously has a lot of discussion about this.

    siva swami said:
    2. Can I give 3.3v square wave signal directly to adc so that low pass filter won't come into picture and I can implement digital low pass filter in dsp. Or can you tell me what interface can be done between 3.3v to 0v varying square signal to adc pin so that it won't get affected?

    The full scale range of the F28335 ADC is 0 to 3V.  You can pass through the square wave directly to the ADC input, but you will lose any resolution above 3V.  The accuracy of the digital square wave representation will also be affected by the signal frequency.

  • Dear tlee,

    1. As you mentioned my issue sorted with low value of resistor and bigger value of capacitor but increased the delay.

    2. As you mentioned, I can give 3.3v square wave to adc but resolution I will loose. I want to mention that I want to compare all values I don't want exact values but I want to compare 10 square wave values. So if it is the case only I want values for comparison, should I worry about resolution?.

    Thanks,
  • Siva,

    It sounds like the phase lag is not acceptable for your application?

    If your input is truly a digital square wave, would it really matter that you lose out on resolution above 3V?  Isn't the signal either logic high or logic low?

    I see another discussion here, perhaps for the same project.  I think the eCAP would be a good digital option

    Otherwise, you can also use EPWM or TIMER interrupts to sample the signal use GPIO.

    -Tommy

  • Siva,

    It has been about two weeks since your last update. I assume that you were able to resolve your issue. If this isn’t the case, please reject this resolution and reply to this thread. If this thread is locked, please make a new thread describing the current status of your issue.

    -Tommy