S08QG8 ADC

cancel
Showing results for 
Search instead for 
Did you mean: 

S08QG8 ADC

1,939 Views
euge
Contributor I
hI
I'm testing a 9S08QG8 micro.
When I test the ADC it work like a 12bits converter.
I"m working with 3,3V and when I read VrefH on the ADCRH: ADCRL the FFE value.
I believe that if the ADC is 10bits I would have to read 3FF.
With a trimpot conected to 3,3V  and changing from 0V to 3,3V the register change from 0000 to 0FFE 
Which is my error??
or the ADC is it 12 Bits ??
Best Regards
Eugenio
Labels (1)
0 Kudos
4 Replies

92 Views
allawtterb
Contributor IV
You are correct in that the ADC is at most 10-bits, the upper 2 bits of the lower nibble of ADCRH should not be set.  How are you testing that it is varying between these values? Does your tests show that it uses all values from 0x000 to 0xFFE?
0 Kudos

92 Views
JimDon
Senior Contributor III
In fact, the specification "promises" that bits 2-7 will always read at 0.
I just tried it on my DEMOQG8 board, and it reads 0 to 3fe.

Here is a link to download this sample code from Axiom, which I have tested.



0 Kudos

92 Views
euge
Contributor I
JinDom:
Thanks by your aswer. After compare your link we discovered an error
We wrote ADCCFG_MODE=1; that is a reserved value and ADCCFG_MODE must be 2 to convert 10 bits.
But it is interesting to knoe that ADCCFG_MODE=1 apparently work at 12 bits, we test with diferents voltage values and really work. May be for freescale is unreliable
Best Regards
Eugenio
0 Kudos

92 Views
JimDon
Senior Contributor III
Glad to hear you resolved the problem. I had a feeling it was something in the setup. This is also a great set of examples for the chip.

Well, it could be that is for internal test only.

In fairness the spec sheet did say "reserved", which means don't do this.
The chip is only spec'ed to 10 bits, so don't count on this working with out possible side effects.





Message Edited by JimDon on 2008-03-17 02:05 PM
0 Kudos