I'm using the LPC54608 ADC with MCUXpresso and everything is working fine until I test some ESD at the proximity of the board. Sometimes, at the ESD, I see that the converter locks in the while statement that I have to wait until the conversion is done.
I'm working with 180MHz system clock and synchronous ADC clock at 60MHz. This is the code to do the conversion:
uint16_t ad_PointsConversion(void){
adc_result_info_t adcResultInfoStruct;
adc_conv_seq_config_t adcConvSeqConfigStruct;
uint32_t result;
adcConvSeqConfigStruct.channelMask = (1U);/* Internal temperature sensor channel*/
adcConvSeqConfigStruct.triggerMask = 0U;
adcConvSeqConfigStruct.triggerPolarity = kADC_TriggerPolarityNegativeEdge;
adcConvSeqConfigStruct.enableSingleStep = false;
adcConvSeqConfigStruct.enableSyncBypass = false;
adcConvSeqConfigStruct.interruptMode = kADC_InterruptForEachSequence;
ADC_SetConvSeqAConfig(AD_ADC_BASE, &adcConvSeqConfigStruct);
ADC_EnableConvSeqA(AD_ADC_BASE, true); /* Enable the conversion sequence A. */
/* Clear the result register. */
ADC_GetConvSeqAGlobalConversionResult(AD_ADC_BASE, &adcResultInfoStruct);
ADC_DoSoftwareTriggerConvSeqA(AD_ADC_BASE);
while (!ADC_GetConvSeqAGlobalConversionResult(AD_ADC_BASE, &adcResultInfoStruct))
{
}
result = adcResultInfoStruct.result;
ADC_EnableConvSeqA(AD_ADC_BASE, false); /* Disable the conversion sequence A. */
return result;
}
Sometimes, I can recover the ADC with a new ESD. Is there any reported issue about ADC locking due to noise at VREFP or AVDD? Any idea to avoid this locking?