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.

ADC not correct

Other Parts Discussed in Thread: TMS320F28377S, THS4521

Hi,

I am trying to run the ADC on TMS320F28377S but it is not reading correctly and the value is changing in 12 bit by 30 when it is measuring constant voltage. 

Any suggestion?

I have followed the ADC example from the control suit.

thanks

  • Hi,

    The ADC values would fluctuate w.r.t. the source. 12-30 is what you observe when you ground the ADCpin? Also, is this hardware -the launchpad?

    Regards,
    Gautam
  • Hi.

    Thanks for your reply

    I am not sure about grounded adc now. I guess yes, It is fluctuating. I will check tomorrow.

    Yes. It is launchpad board.

    Actually I have measured the sensor with arduino before, the fluctuation was much less than this. Of course it had less resolution also. But the sensor has more resolution than this fluctuations. How can I reduce it?

    Another problem is that the average conversion is wrong about 0.1 volt. Why?

    Regards,

    Yousof

  • Hi Yousof,

    ADC variations can be due to multiple reasons. Search the forum for multiple solutions for bringing down the variation.

    Regards,
    Gautam
  • Hi Yousof,

    As far as the conversions being off by 0.1V, are you assuming that the Launchpad full-scale range is 0V to 3.0V, or something else? The conversion to voltage should be (code/4096)*3.0V.

    As far as the fluctuations, I would look at the impedance of your signal source and compare this to the ADC input model and the selected S+H duration. You may have to use a S+H window longer than the minimum of 75ns if your signal source has an impedance > about 50 ohms, or if you have some capacitance on the ADC pin. You can use SPICE or analytical models to determine this (check the TRM, and also my post history for more details).
  • Hi Devin,

    Thanks for the reply.

    Yes, I am using that equation to convert to voltage value.

    I do not have access to your post history.

  • You can check his post history by clicking on his profile name and check his Activity tab.
  • Hi Devin.

    about the wrong conversion, it was a mistake in measurement. the multimeter had effects on the voltages (and voltage divider) on the circuit and it caused a drop voltage on them. So it is working fine.

    I used a voltage follower (with an op-amp) and the fluctuation is less. it is about 6 in 12 bit and 31 in 16 bit conversion.

    I would like to know can I have it better?
  • Yousof Ebneddin Hamidi said:
    I used a voltage follower (with an op-amp) and the fluctuation is less. it is about 6 in 12 bit and 31 in 16 bit conversion.

    That pretty descent. Further you can implement moving average or simple averaging of values.

    Regards,

    Gautam

  • For 12-bit, adding a LP filter on the pin, after the op-amp buffer can help.  You have to weigh the added settling time of a larger R and C (as well as reduced signal bandwidth) against the noise reduction.


    For 16-bit mode, is your signal source natively differential, or do you do single-ended to differential conversion via an op-amp (or pair of op-amps)?  Are you sure that the source itself is stable at 16-bits?  Again, a low-pass filter may help, but in this case you would use equal R values for each half of the differential signal, and you would want the C of the LP filter to be between the differential signals and not to ground.  Layout and cabling will also be very important for 16-bit operation, which may not be optimal on the launchpad.

  • No, the sensor signal is not differential native. I am not sure is it correct or not. I connected the negative input of the ADC to ground.
    So, because I am not sure what I am doing, I will go with 12 bit ADC single-ended mode.

    Yes, the sensor has enough resolution to have a better reading. it has the resolution about 8 value in 16-bit ADC.

    Thanks

  • Hi Yousof,

    The 16-bit mode requires a differential input.  Grounding the negative won't work.  Essentially you want to generate the compliment of the single-ended signal about VREFHI/2.  So if VREFHI is 2.5V and the positive input is 2.4V, then the negative input should be 0.1V.  If the positive input is 1.3V then the negative input should be 1.2V.  If the positive is 0.3V the negative should be 2.2V...etc.

    The way to accomplish this is either using a "fully differential" op-amp, which actually has two outputs, or to use a pair of op-amps to both buffer the signal and generate the compliment.  Here is one TI example design for the two op-amp circuit (the voltage range isn't quite right for the F2837xS ADC, but this should give you an idea): http://www.ti.com/tool/TIPD131.  Below is also a screen capture from the THS4521 datasheet, which should give you an idea of how to build a circuit with a single fully-differential op-amp.  

    If you need additional help designing a circuit or selecting an op-amp, you can always post in the amplifier sections of the e2e forums and someone will help you out there.