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.

TMS570LC4357: Clarification about converting ADC count to voltage

Part Number: TMS570LC4357

Tool/software:

Dear Ti, 

In the datasheet for the TMS570LC4357, the mibADC section lists the following regarding the ADC counts in 12-bit mode:

1 LSB = (AD_REFHI – AD_REFLO) / 2^12

Using this formula, the corresponding voltage should be 

AD_REFLO + (ADC_COUNT) * (AD_REFHI – AD_REFLO) / 2^12

This formula does not seem correct to me. Suppose the ADC is reporting the max value for a given pin, 0xFFF. Intuitively, we would expect our voltage to be AD_REFHI (or greater). However, since 0xFFF equals 2^12 - 1,

we instead get a voltage that is less than AD_REFHI. In fact, our ADC is never able to detect voltages equal to AD_REFHI using this formula.

Should the formula instead be 

1 LSB = (AD_REFHI – AD_REFLO) / (2^12 - 1)

or is the former formula correct?