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.

TMS320F28377D: ADC resolution formula

Part Number: TMS320F28377D
Other Parts Discussed in Thread: TMS570LC4357,

Hi,

In reference to the TRM spruhm8i, table 11-4, just wondering why the formula below uses 4096 instead of 4095, because the resolution is generally calculated with 2^n - 1.

For example, consider a 2 bit ADC, VREFHI = 3V, VREFLO = 0V. Below is the volts calculations. Calculation with 2^n - 1 look more accurate.

Raw Value Volts as per TRM (2^n) Volts with 2^n - 1
0 0/4 X 3 = 0 0/3 X 3 = 0
1 1/4 X 3 = 0.75 1/3 X 3 = 1
2 2/4 X 3 = 1.50 2/3 X 3 = 2
3 3/4 X 3 = 2.25 3/3 X 3 = 3

Thank you.

Gobind Singh

  • Hello Gobind,

    The ADC result values are zero-indexed, meaning the count starts at 0 and goes to 4095. This range is a length of 4096 because it's a 12-bit ADC, hence the denominator.

    I'm not sure where you're deriving the 2^n-1 as being part of the resolution equation. I double-checked online, the equation used to compute an ADC resolution is (VH-VL)/2^n, I did not find anywhere mentions of 2^n-1. The ADC converts it to a digital value, meaning the range of a 12-bit ADC will be 4096 not 4095. Can you please clarify what you mean by using 2^n-1 for the resolution? I've included links to some other places online that I looked at.

    Best regards,

    Omer Amir

  • Hi Omer, 

    Thanks for the response. I checked the links that you shared. 

    1. In the first link (www.learningaboutelectronics.com), at the bottom there is a link to "Analog-To-Digital (ADC) Conversion Calculator". In that link, there is a formula (below screenshot). It says maximum ADC value, which is 4095 for 12 bit ADC.

    2. In the second link ("binaryupdates.com"), below is the screenshot. Formula says 2^10, but the value that is used is 2^10-1 = 1023.

    3. In the third link (rfwireless-world.com), I used the calculator to calculate the digital value for 3V input, with 3V ref and 2-bit ADC. It gives 4V digital for a 3V reference input, which is definitely incorrect in my understanding. See below:

    4. There are other places that I looked, for example https://www.nxp.com/docs/en/application-note/AN5250.pdf section 2.3.1. Screenshot is below:

    I know it is confusing, but if you look at the 2-bit example I gave in my question - it looks like 2^n-1 gives a better representation of the whole range. I understand the it is 0 indexed and range from 0 to 4095 for 12 bit ADC, that will be 4096 values. But I think we are missing that 0 raw value represent 0V (NO VOLTAGE) - so I think '0' should not be considered when calculating resolution.

    Thank you.

    Gobind Singh

  • Hello Gobind,

    I talked with another expert to get a clearer explanation.

    Essentially, the calculations in our spec and datasheet are based off the resolution of VREF/2^n. Looking at the step size for an ideal 12-bit ADC, digital code 0 will be input voltages less than 0.5LSB, 1 will be >0.5LSB to <1.5LSB, 2 will be >1.5LSB to <2.5LSB…4095 will be >4094.5LSB, which gives 4096 steps.

    Best regards,

    Omer Amir

  • Hi Omer,

    Thanks for the reply.

    Just applying ideal ADC calculations to 2-bit ADC logic for simple calculations and in comparison to the example in the problem statement, below are the raw values and their corresponding volts values.

    Raw Volts
    0 (0 + 0.5) / 4 * 3 = 0.375 V
    1 (1 + 0.5) / 4 * 3 = 1.125
    2 (2 + 0.5) / 4 * 3 = 1.875
    3 (3 + 0.5) / 4 * 3 = 2.625

    Is this how you were suggesting we calculate volts? These numbers look better than the ones for 2^n in the example in problem statement.

    Thank you.

    Gobind Singh

  • Hello Gobind,

    Yes, your understanding is correct.

    Best regards,

    Omer Amir

  • Hi Omer,

    I checked TRM of TMS570LC4357, the ADC resolution specified in that has that 0.5 factor in it as below:

    Should this be added in the TRM of TMS320F28377D also? Because if you are suggesting the correct way of calculating volts is with 0.5 factor, it should be mentioned in the TRM.

    Thank you.

    Gobind Singh

  • Hello Gobind,

    It may be more practical for you to use this sort of equation, I'm currently in the process of adding some clarifying information to our reference manual on this. The change should be in the next update to the document.

    Best regards,

    Omer Amir

  • Thank you Omer for patiently reading my question and replies.