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.

AdcOffsetSelfCal for TMS320F28027

Other Parts Discussed in Thread: TMS320F28027

I have questions for ADCoffsetSelfCal function

1. TMS320F28027 dosent have "B5". SO how it will conect VREFLO to B5.

2. The settings are not normalized after the function returns to normal

for example  // ADCINT1 and ADCINT2 is disabled at the end of the function. However, the settings 

1.// Disable continuous sampling for ADCINT1 and ADCINT2

2./ADCINTs trigger at end of conversion

3.// Setup ADCINT1 and ADCINT2 trigger source

4. // Setup each SOC's ADCINT trigger source

are not disabled at the end of function or u can say to there default value.

3. Will it affect my ADC samplig which are programmed to trigger by CPU timer. As in above said function they are triggered from ADC interrupts and are force start.

4. As my running above function periodically to reduce offset error, will it affect my existing ADC settings or I have to make my ADC settings again

  • Hi Ashutosh,

    The B5 connection to VREFLO is internal, so no device pin is needed.

    The function is not meant to be called while the application is running. You can use this at start up to do one-time offset calibration before the application ADC settings are configured (make sure to overwrite all changes that the function code made).

    If you want to do periodic re-calibration, you should add sampling on the B5 VREFLO connection to your application code. If you are periodically sampling some signals as driven by the CPU timer, add an SOC to this group and use it to sample B5/VREFLO. Accumulate these samples and take an average. Use the average to adjust the offset trim register.

    One more point about periodic re-calibration: you won't be able to see how much you need to adjust the trim up if the offset error drives the VREFLO conversions below a digital result of 0. The easiest way to deal with this is to target an offset error of +1 LSBs instead of 0 LSBs. You can then do digital calibration of the other conversion results by subtracting 1 if desired.
  • Dear
    I didn't understood how to implement this part
    Can u explain it

    "The easiest way to deal with this is to target an offset error of +1 LSBs instead of 0 LSBs. You can then do digital calibration of the other conversion results by subtracting 1 if desired."
  • If the offset error is positive, converting VREFLO will give a value higher than 0. It is easy to take this value, and adjust the offset trim accordingly. However, if the offset error is negative, converting VREFLO will give a value of 0, so there is no way to correctly adjust the offset.

    If you look at the example offset calibration code, we set an artificial positive offset of 80, measure the VREFLO value, and then write a new offset value, accounting for the artificial offset that we added earlier. Now instead of a positive offset error producing a value above 0, it produces a value above 80, and a a negative offset error will produce a reading below 80, which we can use to do the calibration.

    If you are integrating the offset measurement code into your application, you probably don't want to have to manually set a large offset and ensure no other conversions are running, measure the offset, and then set everything back. So if you don't set an artificial offset, you can target an offset of +1 LSBs instead of 0. If the offset error is negative, you will measure 0, and then you adjust the offset up by 1. If the offset error is greater than -1, subsequent iterations of the procedure will eventually drive the offset error to 1. The offset error drifts mainly with temperature, so it shouldn't be changing fast once it is calibrated.