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.

ADC Offset Cal

Other Parts Discussed in Thread: TMS320F28033

Hello

I am using a TMS320F28033 in a digital control loop.  I believe that I am seeing approximately a 15 count offset and would like to improve accuracy by re-calibrating the ADC offset continuously.    I can not use the TI AdcOffsetSelfCal() code because the 80 count offset temporarily loaded in the ADCOFFTRIM register would also affect the control loop running in the background causing large transients (there is a large gain from the ADC to my system output).    If I dedicate an ADC line to monitoring the VrefLo, is there a way to write my own cal offset routine without the 80 count offset?.  I would still like to use the ADCOFFTRIM register for the sake of speed and not having to rewrite an ISR written in assembly.

 

 

Out of curiosity, is ADCOFFTRIM, a digital correction after the ADC or does it inject an analog offset into the ADC input?  

Thanks.

  • Hi Mark,

    The ADCOFFTRIM is actually an analog trim register. Because of this, adding the artificial offset allows you to measure a negative offset (whereas if you hadn't added the artificial offset, you will convert '0' whether the actual offset is 0 , -1, or -20 LSBs).

    To do on-line offset calibration, you should periodically measure VREFLO along with your other signals of interest. You will probably want to aggregate these over time, and then when you have say 128 samples, divide down to get an averaged sample. Instead of adjusting the offset to try get it to 0, you will need to target something positive like 1 LSBs. So if you measure '0' after averaging, you will increase the trim by 1, if you measure 2 you will decrease the trim by 1, and if you measure 10 you will decrease the trim by 9. This way, even if the trim is negative you will eventually converge on 1 LSBs of error. The offset trim also shouldn't drift very fast, so correcting by only 1 LSB at a time shouldn't be an issue.

    This method will give you +1 LSB of constant offset. For critical signals you could do a digital correction or otherwise adjust your control algorithms to compensate.
  • So convert an unknown +/- offset into a fixed positive offset which can be subtracted out of the control loop setpoint. I think I can work with that! Thanks very much for your speedy answer.