Incomplete ADC conversions on LPC1224

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Nathael on Fri Sep 19 02:23:42 MST 2014
Hi all,

I have a problem with ADC conversions, wich are incomplete when I reduce the delay between two samples, even if the "done" bit is set.
I've tested about everything I could find, but to no end.

The first few conversions after reset are OK (same value as with a longer delay between two samples), but then the conversions stop after 6 bits of sampling : I always get 63 or (1024 - 63 = 961) as conversion values if the voltage is above 200mV (which corresponds to value 63 if power is 3.2V)
Edit : the conversions on the top values are also OK, if voltage is between Vref and Vref-200mV I also have valid values.

If the delay between two software triggered conversions is above 250ms I have no problem.
If the voltage is below 200mV I can run samples with as little as 10ms between each with no problem (did not test lower delay).

I tried software triggered single conversions, burst conversions of single and multiple channels, and timer triggered conversions of single and multiple channels, same problem. (Not with the provided code, burst and timer triggered conversions are not supported yet in this code)

I tried with a precision LDO of 3.0V as Vref, with powerfull, stabilized, lab power supply able to provide 2.5A, but no changes. A scope sees no variation on VDD or Vref.

I do not understand why changing the delay between two samples triggers a different behaviour.

I also can sample 3 channels with a 10ms delay between the channel samples, but then the delay before the next sample set has to be three times longer ....

Code to reproduce the problem can be found here : http://git.techno-innov.fr/?p=mod_gpio_demo  (only single software trigered conversions possible with this code, but enougth to reproduce the problem)
Add "adc_display(LPC_ADC_NUM(1));" before the end of the while loop and it will display the adc channel 1 conversion value on UART1 (UART may be changed in examples.c, it is the first argument of the serial_write call)
You can change the ADC number in LPC_ADC_NUM(1) (between 0 and 7).

The "default" delay allows infinite conversions with no errors, but if you change the delay value (25) in chenillard(25); to "2", then you can see the problem.

Compile using gcc under linux (run "make" in the main directory) and flash using lpctools (package available in debian SID, or source code available here : http://git.techno-innov.fr/?p=lpctools).

Warning, the code changes the content of the user information flash, to prevent this remove the "#define USER_INFO 1" line.

The board used is my gpio Demo module, board schematics are available here : http://techdata.techno-innov.fr/Modules/GPIO_Demo/System_Reference_Manual_Module_GPIO_Demo_v03.pdf