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.

TMS320F28379D: 16 - bit Differential ADC Decoding

Part Number: TMS320F28379D

Hi, 

I am using 28379D Microcontroller to read current sensor reading through 16 - bit differential ADC.
I am using Channel A2 and A3.  A2 (positive) is connected to ground (PCB ground)  and A3 (negative) is the analog sensing coming from current sensor

I went through the TRM .. 
1. It says Vcm should be within Vref/2 within +-50mV.. In my case if my analog sensing voltage is read For ex: 1.3V, if I calculate Vcm then it will be (1.3 + 0)/2 = 0.65V, and (3.3 + 0)/2 = 1.65V.. so with this logic Vcm is not within range to 1.65V +- 50mV. So I want be able to use 16 -bit Differential ADC . Is my understanding correct ?
2. The decoding of 16 - bit differential ADC in the below image shows division factor as 2048, how is this derived ? Shouldnt it be 32767(considering the output will be positive and negative) or 65535 


Thanks 
Tanmay

2370813c-eb3c-42eb-868b-4706c303e310.png

  • Hi Tanmay,

    I will get back to you on this within next 24hrs. 

    Thanks

    Srikanth

  • Hi Tanmay,

    For a differential ADC input:

    • The common mode voltage (Vcm) is calculated as (V+ + V-)/2
    • In your case: Vcm = (0V + 1.3V)/2 = 0.65V

    According to the TRM, Vcm should be within Vref/2 ± 50mV:

    • Vref/2 = 3.3V/2 = 1.65V
    • Acceptable range: 1.60V to 1.70V

    Your Vcm of 0.65V is outside this range, which means you're correct that this configuration doesn't meet the differential ADC requirements.

    Solutions:

    1. Use single-ended mode instead of differential
    2. Add a bias voltage to both inputs to shift the common mode into the acceptable range
    3. Use a level shifter circuit to adjust your signal levels

    Regarding the Division Factor of 2048

    For a 12-bit ADC core (which the TMS320F28379D uses), the full-scale range in differential mode spans from -Vref to +Vref, giving 2^12 = 4096 codes.

    Since this range represents 2×Vref volts, each code equals 2×Vref/4096 = Vref/2048 volts.

    This is why the conversion factor is 2048, not 32767 or 65535. The 16-bit result you see is the 12-bit ADC result that has been left-shifted by 4 bits (multiplied by 16) for increased resolution in the digital domain.
    Thanks
    Srikanth
  • Hi Srikanth, 

    Thanks for clarifying .. 
    Also we dig deep in this issue past week, until previous 2-3 months we used 16-bit and single ended mode and used to decode the 16 bit ADC to Voltage using (Vref * ADC Value)/65535. This somehow matched our sensor values. Is this an acceptable mode and logic ? 

    Thanks, 
    Tanmay 


  • Hi Tanmay,

    The TMS320F28379D does not have a true 16-bit ADC. It has a 12-bit ADC core that can operate in:

    1. 12-bit single-ended mode (most common)
    2. 16-bit differential mode

    When the 12-bit result is stored in a 16-bit register, the hardware left-shifts the result by 4 bits (multiplying by 16). This creates what appears to be a "16-bit" value, but the true resolution remains 12 bits.

    What You Were Actually Using

    What you referred to as "16-bit single-ended mode" was actually the 12-bit single-ended mode with the result left-shifted to fill a 16-bit register.

    The correct formula for converting this value to voltage would be:

    • (Vref * ADC_Value) / 4095 if using the raw 12-bit value
    • (Vref * ADC_Value) / 65535 if using the left-shifted value

    There is no true "16-bit single-ended mode" in this device, but your approach of using the left-shifted 12-bit result as if it were a 16-bit value might be working in your case.
    Thanks
    Srikanth