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.
Solved! Go to Solution.
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:
2. what does it mean by ADC_CR_CALMODEBIT?
CALMODE it bit 30, you can find it from the user manual:
I think maybe you want to ask ADC_CR_ASYNMODE, it is bit 8, I think it just want to clear these bit.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Kerry Zhou thanks so much. You are aright, I wanted to ask about ADC_CR_ASYNMODE...
Thanks a lot! Regards. Daniel.
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:
2. what does it mean by ADC_CR_CALMODEBIT?
CALMODE it bit 30, you can find it from the user manual:
I think maybe you want to ask ADC_CR_ASYNMODE, it is bit 8, I think it just want to clear these bit.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------