AnsweredAssumed Answered

LPC55s69 LPADC  Calibration code

Question asked by Hy Mai Employee on Sep 20, 2019
Latest reply on Sep 27, 2019 by xiangjun.rong

S

hDear LPC55xx support,

Customer : I-Blades.

 

  I-blades was looking at the lpadc sample code to figure out how the calibration code works .After stepping through the code they realize that the sample code does not actual go thru the calibration procedure but simply writes to fixed values of 10 into the calibration offset register.

Q: Are those values specific for the eval Board ?

 

Snippet of Calibration code:

 

#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS
#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM
    /* Request offset calibration. */
    if (true == DEMO_LPADC_DO_OFFSET_CALIBRATION)
    {
        LPADC_DoOffsetCalibration(DEMO_LPADC_BASE);
    }
    else
    {
        LPADC_SetOffsetValue(DEMO_LPADC_BASE, DEMO_LPADC_OFFSET_VALUE_A, DEMO_LPADC_OFFSET_VALUE_B);
    }
#endif /* FSL_FEATURE_LPADC_HAS_OFSTRIM */
    /* Request gain calibration. */
    LPADC_DoAutoCalibration(DEMO_LPADC_BASE);
#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */

 

 

if you use the debugger and step thru this code you will see that the line :

 

  LPADC_SetOffsetValue(DEMO_LPADC_BASE, DEMO_LPADC_OFFSET_VALUE_A, DEMO_LPADC_OFFSET_VALUE_B);

 

is the only line that is executed.

As you can see from the code below the LPADC_DoAutoCAlibration is greyout  by the #if Defined at the top so there is no auto calibration taken place.

Q: what is the reason for not  calling the auto calibration in the demo code?

Q: If the customer want to use this calibration for his own board, can he just call it?

 

Outcomes