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) */
/* 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.