Problem with ADC1763 ADC

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by alexxx on Tue Jun 25 23:31:01 MST 2013



I read ADC every 10ms, inside systick interrupt. It is ADC 0. The problem is that every now and then (something like once or twice in a minute), the ADC returns 0xFFF. I investigated with the oscilloscope, but there is nothing wrong with hardware line on ADC0. Has anyone experienced a similar problem? I am using LPC1763, IAR compiler. My code is:

void initialize_adc (void)


  ADC_Init(LPC_ADC, 100000);  //100KHz




unsigned int return_adc_channel ( const unsigned char CHANNEL_SETUP )   //CHANNEL_SETUP is always 0 for this project


  _UINT temp;<span class="Apple-tab-span" style="white-space: pre;"> </span>//this is a union


  // Start conversion



  //Wait conversion complete

  while (!(ADC_ChannelGetStatus(LPC_ADC,CHANNEL_SETUP,ADC_DATA_DONE)));


  //get ADC data

  temp.ivalue = ADC_ChannelGetData(LPC_ADC,CHANNEL_SETUP);

  return temp.ivalue;




So the problem is that this temp.ivalue returns a 0xFFF, but the voltage on ADC0 doesn't change. After this faulty measurement in the next ADC conversion, the returned value is again OK.