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.

TMS320F28P550SJ: ADC VREF configuration

Part Number: TMS320F28P550SJ
Other Parts Discussed in Thread: SYSCONFIG

Hello,

We are currently using the micrcontroller f28p55x to acquire electrical signals with a expected full scale voltage of 3v3. We want to use the external reference of 3v3 fed thourgh the pin VREfHI and have a full scale voltage inseide the ADC of 3v3.

I have encoountered one issue while configuring the Analog subsistem reference registers which I will better explain with an example.

I am measuring a ocnstant voltage of 48V with the ADC, VrefHI 3v3 and the reference set to external thourgh the register REFPMUXSEL. I ADC input pin that measures the voltage, there is 2.556V which should result in a value of 3151 counts aprox. The problem I see is that the counts perceived are 1605 counts and I en up receiving a value of 24V. I saw that the issue is caused becasue of the register ANAREFX1P65SEL which is set to 1. If i put this register to 0, the ADC counts shown in the debug view are 3100 as expected.

My questions are the following:

  • I saw TI recommend to set ANAREFX1P65SEL whenever using a external refences higher than 2.95 in technical refernce manual. Why is that? Why am i not able to configure that register to 0 to have the pin voltage at 3.3v?
  • If register ANAREFX1P65SEL is set to 1, does it mean I can not put a voltage to the pin higher of 1.65V? If so, why am I seing a Value of 1605 instead a saturation value providing that the votlage at the pin is 2.556 and higher than 1.65V?
  • Where does it come this scaling of /2 in the measurement? How does affect having a reference of 1.65 at the pin but having a VREFHI of 3v3? I am not undestanding well the specification in page 138 datsheet.(Image attached). I neither unsdetand the specification on technical reference manual, the part where says "When used with external reference,
    use 2P5 mode for all VREFHI <2.97V,
    for FSR 3.3V use 1P65 with 1.65V
    applied to VREFHI." image.pngimage.png

Regards,

David

  • Hi David,

    The ANAREFx1P65SEL bit is what’s causing the “/2” behavior you’re seeing. If ANAREFx1P65SEL = 0, then in external reference mode the ADC full-scale range (FSR) = VREFHI pin voltage. So if you drive VREFHI = 3.3 V, the ADC range is 0–3.3 V, and your around 2.556 V input should read 3170 counts in 12-bit.

    If ANAREFx1P65SEL = 1, then in external reference mode the ADC FSR = 2 * (VREFHI pin voltage) and the VREFHI pin is expected to be around 1.65 V (≤ VDDA/2). If you still drive VREFHI = 3.3 V while this bit is 1, then the ADC FSR becomes 6.6 V, so readings appear about half. 2.556 V / 6.6 V * 4095 = 1586 counts, which matches your =1605 count observation. This is why it does not saturate because 2.556 V is still well below 6.6 V.

    So for your goal (external 3.3 V reference and FSR = 3.3 V), select external reference via the REF mux and set ANAREFx1P65SEL = 0 for the ADC reference block you’re using.

    Best Regards,

    Masoud

  • Hello,

    Thank you for the response. I am still missing 2 more things. 

    - Why in the paragraph on note does specify that we need to use VrefHi pin voltage of <2.97V? It seems a bit misleading as In our case, we have a voltage of 3.3V in VreHi, Therefore, from the notes section there is not option for us to select.

    - Why In SysConfig, this option is non-existent? It only allows me to select external reference but there is no way to change the ANAREFx1P65SEL register. It seems like if it is not recommended to set the ANAREFx1P65SEL to 0 and having an external reference.

    Regards,

    David

  • Hi David,

    That note is trying to describe which mode to pick. Use ANAREFx1P65SEL=0 for normal external reference behavior (FSR = VREFHI) and  use  ANAREFx1P65SEL=1 only if you want FSR=3.3V while applying =1.65V at VREFHI (because the ADC doubles it internally).

    Even though the wording is confusing, you can use VREFHI > 2.97V (e.g., 3.0V/3.3V) with ANAREFx1P65SEL=0, and Driverlib uses the same “EXTERNAL + 2_5V enum” to select that mode.

    SysConfig typically abstracts this via the ADC_setVREF() “reference voltage” enum. For External VREFHI = 3.3V (FSR=3.3V) you generally need:

    ADC_setVREF(ADCx_BASE, ADC_REFERENCE_EXTERNAL, ADC_REFERENCE_2_5V);

    If you instead select:

    ADC_setVREF(ADCx_BASE, ADC_REFERENCE_EXTERNAL, ADC_REFERENCE_3_3V);

    that drives the config toward the 1P65 mode (expects 1.65V on VREFHI), which is exactly the scenario that produces the half scaling if you’re actually feeding 3.3V.

    You can keep SysConfig enabled, but add/override the ADC_setVREF(...EXTERNAL, ...2_5V) call in your init after SysConfig init runs, so it doesn’t get overwritten.

    Best Regards,

    Masoud

  • Hi Masoud,

    Thank you for the explanation. I will go  with the ADC VREF overwrite. 

    Regards,

    David