Chip_ADC_StartCalibration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Chip_ADC_StartCalibration

Jump to solution
1,045 Views
vaque
Contributor II

Hi!;

In adc_8xx.c there is a function to calibrate the ADC: Chip_ADC_StartCalibration:

/* Start ADC calibration */
void Chip_ADC_StartCalibration(LPC_ADC_T *pADC)
{
    /* Set calibration mode */
    pADC->CTRL |= ADC_CR_CALMODEBIT;

    /* Clear ASYNC bit */
    pADC->CTRL &= ~ADC_CR_ASYNMODE;

    /* Setup ADC for about 500KHz (per UM) */
    Chip_ADC_SetClockRate(pADC, 500000);

    /* Clearn low power bit */
    pADC->CTRL &= ~ADC_CR_LPWRMODEBIT;

    /* Calibration is only complete when ADC_CR_CALMODEBIT bit has cleared */
}

I am working with a LPC824. Why is firstly the /*Set calibration mode*/?, shouldn't it be last after the 500KHz SetClockRate?.

And other cuestion, what does it mean by ADC_CR_CALMODEBIT?  it says in UM10800.pdf at page 327 "21.6.1 ADC Control Register"  that the bit 8 (the corresponding of ADC_CR_CALMODEBIT) is reserved.

Thanks so much and regards. Daniel.

Labels (2)
Tags (2)
0 Kudos
Reply
1 Solution
825 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Daniel,

   Answer your two questions:

1. Why is firstly the /*Set calibration mode*/?, shouldn't it be last after the 500KHz SetClockRate?.

This is the calibration correct cycle, the chip just design it like this, you can't change the operation sequence.

You can find it from chapter:

pastedImage_1.png

2. what does it mean by ADC_CR_CALMODEBIT? 

CALMODE it bit 30, you can find it from the user manual:

pastedImage_2.png

I think maybe you want to ask ADC_CR_ASYNMODE, it is bit 8, I think it just want to clear these bit.

pastedImage_3.png

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
2 Replies
825 Views
vaque
Contributor II

Kerry Zhou  thanks so much. You are aright, I wanted to ask about ADC_CR_ASYNMODE...

Thanks a lot! Regards. Daniel.

0 Kudos
Reply
826 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Daniel,

   Answer your two questions:

1. Why is firstly the /*Set calibration mode*/?, shouldn't it be last after the 500KHz SetClockRate?.

This is the calibration correct cycle, the chip just design it like this, you can't change the operation sequence.

You can find it from chapter:

pastedImage_1.png

2. what does it mean by ADC_CR_CALMODEBIT? 

CALMODE it bit 30, you can find it from the user manual:

pastedImage_2.png

I think maybe you want to ask ADC_CR_ASYNMODE, it is bit 8, I think it just want to clear these bit.

pastedImage_3.png

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply