Content originally posted in LPCWare by Rob65 on Sat May 28 10:52:29 MST 2011
The 0 or 4095 values don't look like an ADC noise problem but more a software issue.
Still, Luis is right in suspecting electrical noise problems, I would almost say he is an expert by experience ... - have a look at his thread and take special attention to the two app.notes referred to byNXP. Have real separate analog and digital power domins with a star grounding if you need proper ADC measurements.
Share your PCB layout and/or projects. Unfortunately I do not yet have a 17xx design to test this (still working on the PCB layout) but others do.
Rob