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.

MSP432P4111: Interpreting ADC results when using ADC_SIGNED_BINARY format

Part Number: MSP432P4111

Hello!

I'm using MSP432P4111 microcontroller, I set the ADC module to use ADC_SIGNED_BINARY format, how to interpret the results as voltage?

For example if the mode is ADC_UNSIGNED_BINARY the equation is :

V = ADCMEM * Vref / (2 ^ resolution) = ADCMEM * Vref / (2 ^ 14)

  • Wahib,

      The ADC14_setResultFormat() API sets the ADC14DF bit in the ADC14CTL1 register. The behavioral description for this bit can be found in the MSP432 Technical reference manual, Table 22-6 (ADC14CTL1 Reg Description), copied below:

    ADC14DF

    ADC14 data read-back format. Data is always stored in the binary unsigned format.

    0b = Binary unsigned. Theoretically, for ADC14DIF = 0 and 14-bit mode, the analog input voltage - V(REF) results in 0000h, and the analog input voltage + V(REF) results in 3FFFh.

    1b = Signed binary (2s complement), left aligned. Theoretically, for ADC14DIF = 0 and 14-bit mode, the analog input voltage - V(REF) results in 8000h, and the analog input voltage + V(REF) results in 7FFCh.

    Setting ADC14_SIGNED_BINARY means setting ADC14DF=1, so the output value becomes:

    V= Vref * ADCMEM/ (2^16) 

    Note that I'm dividing by 2^16 because the TRM description indicates that the 14-bit result is shifted by 2 bits in the memory. (which is why the max +Vref value would yield an ADCMEM= 7FFC instead of 3FFF).

    -Bob L.

**Attention** This is a public forum