Jonas Leijon

ADC problems with MC9S08SG8

Discussion created by Jonas Leijon on Feb 1, 2010
Latest reply on Feb 2, 2010 by bigmac




I have a strange problem using the ADC. 

I have no problem sampling 10-bit ADC values but when the value is stable around 768 (0b1100000000) I get "fake" values!!? Both 512 and 1023. This only occurs around 768. 

I have narrowed down the code only to read the ADC value to exclude that the code is wrong:


The code is now simply in a infinitive loop:

iLoad = ADCR; (iLoad is an integer)


I have tried longer sample time, digital buffer disable etc.. I suppose that there is something that I'm missing here!?





 I'm using the DEMO9S08SG8.