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.

2808 eZDSP ADC question

Hello,

I am trying to read in voltages in the range of 0 to 2.8V using the ADC. I am testing by supplying an input through a voltage divider with resistances of 1kohm. The ADC  values I obtain are slightly higher than I would expect, but otherwise fine. My problem is that the voltage at the DSP will never exceed .8V.

The only possibility I can think of would be a reference problem, but I am using all of the default values for references. Is this a coding problem or a problem with the ADC and how would I go about fixing this?

Thank you for the help,

David Foster

 

  • David,

    You don't quantify the results you are getting, but say they are "slightly higher than I would expect."  What does slightly mean?

    I don't think the external voltage divider is the problem.  I assume the digital conversion result you expect is based on the actual voltage at the divider junction, and not just based on the resistor values.

    You said you are reading voltages in the range of 0 to 2.8V, but then say the voltage at the DSP will never exceed ".8V".  Did you mean 2.8V?  Regardless, this seems irrelevant.  The ADC always converts full-scale range from 0 to 3.0V.  It doesn't matter whether you are using the internal or an external reference.  Full-scale range is always 0-3.0V.

    Uncalibrated ADC offset error can be up to  +/-60 LSB, per the F280x device datasheet, #SPRS230m, p.126.  You need to calibrate this out using the ADCOFFTRIM register.  did you do this?

    Also, you need to account for gain error, which can also be as much as +/-60 LSB.  Software calibration on each ADC reading can be done to eliminate this.  There is an appnote on this subject:

    http://focus.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=spraad8a&docCategoryId=1&familyId=1523

    Regards,

    David

  • When I say higher than excepted, I am getting a slope of 2375 for 0 to .8V. This is higher than the expected 1100. I apologize for the vague description before.

     

    When I said it never went past, .8V, I did mean .8V. With just the voltage divider, the voltage's were divided as expected. However when the DSP was attached, the voltage across the DSP and the 2nd resistor never exceeded .8V.

     

    I did not account for a gain error, I will do that. However, I do not think that 60 LSB is the cause of the problem I am experiencing.

  • David,

    If you are getting a converted value of 2375 for 0.8V then something is wrong.  I agree, the gain (and offset) errors are not the cause of this problem.

    Download appnote SPRA958 from the web.  There is code with that appnote that will run on eZdspF2808.  Use the example_nonBIOS_RAM example.  The code has the ADC converting values at a 50 kHz rate.  The result is in the variable array AdcBuf (something like that).   I know the ADC is configured correctly in this appnote.  The code does NOT calibrate the ADCOFFTRIM register or do any gain error calibration.  But as you said, these are only max +/-60 LSB each (usually much less).  You have much more error than that.  The code DOES run the ADCCAL routine located in the bootROM.  The ADCCAL routine must be run in order to bring the ADC up to the specs in the datasheet (i.e., without the ADCCAL, the gain and offset errors can be worse than +/-60LSB).  The ADCCAL routine is always run when the bootloader runs.  The appnote code is calling it for a second time just in case someone bypasses the bootloader via Code Composer Studio.

    I like to use a AA battery as a test signal.  You can solder a couple of wires onto the ends of the battery (i.e., GND and VPOS).  It gives a nice 1.5V signal that is foolproof (so that you can't accidentally twist the knob on a power supply and zap the processor ADC with mega voltage).

    Regards,

    David