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.

TMS320F280049: Device_cal()

Part Number: TMS320F280049

"The Device_cal() function copies the trim values for ADC linearity, ADC offset, PGA gain and offset,
and DAC offset from OTP memory to their respective trim registers." (from TRM)

I have noticed on the Emulation register settings that the AdcaRegs.ADCOFFTRIM gets set to a non-zero value.

In my case, the value was updated to "0x00F0" - what does that mean?

However, what other registers are affected by Device_cal()? I do not see a "ADCLINTRIM" listed in CCS.

  • Hi Todd,

    ADCOFFTRIM value of 0xF0 corresponds to an offset of -1 conversion count.  Please refer how to decode this value in the ADC Registers section of the TRM (ADCOFFTRIM.OFFTRIM).

    ADCINLTRIM, which is the calibration for the ADCs linearity performance is also populated during device cal call.   Registers ADCINLTRIM1, ADCINLTRIM2 and ADCINLTRIM3 are populated from values which were derived during factory testing,  Per TRM description of these registers, they should not be modified by the users as this would cause issues with linearity.

    Best regards,

    Joseph

  • Thanks for the reply. So, an offset of -1 I would rate as very good, correct? There is not really any description of ADCINLTRIMx - I have no idea how to interpret any values that I might see in those registers. Do the 3 values correspond to 3 areas of linearity? Like thirds?
  • Hi Todd,

    Yes, a -1 offset is considered very good. The ADCINLTRIMx registers are intended to compensate for the internal components of the ADC IP. The registers do not map to different segments of the transfer plot, unfortunately.

    Regards,
    Joseph
  • Thanks, Joseph.
    I did find that SetVREF( ) not only sets up the VREF (in our case for external voltage reference), but it also transfers the value of the TRIM register to ADCOFFTRIM from OTP.
  • Hi Todd,

    Yes, that is correct.  There is a difference in the ADC offset in the F28004x device when operating in 3.3V internal VREF mode versus all the other modes (internal 2.5v and external VREF regardless of the voltage level) so to take care of this, the supplemental function ADC_setVREF() was created. At boot time, device_cal() is automatically invoked and along with the other analog trim value population, adcoffset with external VREF/internal 2.5V is copied over to the offset register.  The VREF mode that application code will use is not known during boot up time, hence this ADC_setVREF() function was added to take care of this.  Sorry, I did not mention this earlier.

    Let me know if you have other questions on this topic.

    Best regards,

    Joseph

  • Hi Todd,

    Have not heard from you on this topic so I am assuming this resolved your issue.  If not, please feel free to post related questions on the forum.

    Thanks!

    Joseph