High ADC offset on MC9S08QB4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

High ADC offset on MC9S08QB4

Jump to solution
662 Views
benthie
Contributor II

Hi everybody,

 

I just noticed, that my ADC has a very high offset when measuring 0V. It is about 550d. Measuring 3.3V does not make problems, I usually get the 4095d. I also tried 1V and 2V, both were measured correctly.

 

As the title says, I am working on a QB4 with V_DD = 3.3V.

 

Some ideas what might cause this problem?

 

Regards,

Ben

Labels (1)
0 Kudos
1 Solution
464 Views
pavel_sadek
NXP Employee
NXP Employee

HI

ADC sees minimal value of 0.44V for whatever reason.

How is your device / ADC pin connected?

first of all check your circuit (schematic / test it with multimeter for expected voltages),

next, I would do bunch of measurements, that can help with diagnostics

do the measurement of

  • Vrefl should be 0,
  • Vrefh should be your full scale (mentioned 4095) - this still does not say you anything about the reality of your issue
  • internal bandgap - that is internally connected reference of some 1.17V on AD27,  Selecting the internal bandgap channel requires BGBE = 1 in SPMSC1

ADC_1.png


Pavel

View solution in original post

0 Kudos
4 Replies
465 Views
pavel_sadek
NXP Employee
NXP Employee

HI

ADC sees minimal value of 0.44V for whatever reason.

How is your device / ADC pin connected?

first of all check your circuit (schematic / test it with multimeter for expected voltages),

next, I would do bunch of measurements, that can help with diagnostics

do the measurement of

  • Vrefl should be 0,
  • Vrefh should be your full scale (mentioned 4095) - this still does not say you anything about the reality of your issue
  • internal bandgap - that is internally connected reference of some 1.17V on AD27,  Selecting the internal bandgap channel requires BGBE = 1 in SPMSC1

ADC_1.png


Pavel

0 Kudos
464 Views
benthie
Contributor II

Hello Pavel,

measuring V_REFL, V_REFH and V_BG worked properly. Every value was as expected. I also tested the input of my pin with a multimeter and the voltage is also applied. Between pin and voltage source is nothing that could cause such a voltage drop. They are directly connected.

Maybe it is a software problem. I attached my adc.c file, the measurement is done there in the ADC_measureChannel() method. It is called with parameter "1", so channel 0 is measured.

Thanks and regards,

Ben

0 Kudos
464 Views
benthie
Contributor II

Okay - I have found the problem. Another IC caused it. Was not easy to find because the system is working with two different ground potentials.

0 Kudos
464 Views
pavel_sadek
NXP Employee
NXP Employee

HI Ben

OK, you are saying, you have 0V on the pin PTA0 (checked by the multimeter) and ADC sees value of some 550? Strange to me.

There is nothing visibly wrong with the code.

What about output impedance of your source?

Can you test the same in 8bit mode? There is errata related to ADC on QB summary page, however I guess it might be something hardwired on the board.

You  can you also lift the pin up from PCB to disconnect it completely from the source and tie it to ground (rather Vrefl).

now make your ADC measurement - if you see 0 in there, just take the multimeter and look to the net where the pin was previously connected to - it was a leakage.

Pavel

0 Kudos