MPC5554 Strange ADC Sampling Problem

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

MPC5554 Strange ADC Sampling Problem

1,218 Views
kaixionglv
Contributor II

搜狗截图18年05月28日1015_1.png

hello,I have a strange problem using MPC5554 ADC module.

I want to use ADC to sample 2.5V voltage, the accurate number should be 8192 in decimal. firstly, I sample the channel 42, the result is Result[0]= 8221,   then I sample 2.5V voltage generated by the singnal generator,the result is U0=8506; then I put the same code into for loop, as the picture above shows, the result is U1=9800.

U0 is a little larger than  Result[0], maybe I can calibrate it and it will be OK.    But why U0 is different from U1?  the code is the same, why the result is different?   the only diffrence is U1 is in the loop and U0 is out of the loop.

7 Replies

687 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, it could be possibly caused by following erratum.

pastedImage_1.png

You could also try to increase sampling time for internal channel. Definitely it is needed to calibrate ADC modules before use.

687 Views
kaixionglv
Contributor II

thank you so much, I will calibate it later. But the most troublesome thing is that U0 is not equal to U1. I don‘t know why?

as the picture shows, U0 and U1 are resulted from the same code, the only diffenrence is U0 is out of "for " loop , and U1 is in the "for" loop. they should be the same , but actually they are not, I have tried many differenr voltage sources, the problem is still existing.  

the system clock is 128MHZ and the ADC clock is 2MHZ, they are unchanged during my test experiments

0 Kudos

687 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Are you measuring static voltage level?

687 Views
kaixionglv
Contributor II

yes,I measured the DC voltage,  if I put these codes out of "for" loop as U0's codes, U1 is equal to U0, but if I put U1's codes into "for' loop, U1 ia not equal to U0, this is troublesome

0 Kudos

687 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

You could try to increase sampling time for the first measurement (U0), let me know if it affect the result.

pastedImage_1.png

687 Views
kaixionglv
Contributor II

thank you so much , I configure the LST =0B11,    the problem is still existing, but I find how to solve it inspired by you,    I add a delay() function after eQADC initialization,  if the delay time is long enough,   U0 will be equal to U1.

then   I should calibrate the result later.

for example, 2.5v DC voltage, the accurate result should be 8190, but my sampling result is  9786 before calibrating, is it 9786 a reasonable result before cailibrating? I mean if my PCB board is bad or my voltage source is not good, why the result without calibrating is so rediculous?  I have already used many kinds of cheap MCU without ADC calibarating function , the sampling  result is in a reasonable range, why MPC5554's result is so strange ?

0 Kudos

687 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Yes, it is possible. Initial delay is part of recommended calibration sequence as you can see below:

pastedImage_1.png

Try to perform calibration, it is easy - here you may find example code:

Example MPC5644A eQADC channel 146 conversion+calibration CW210 

This device does not have defined offset and gain error for uncalibrated result, but it may be tens or hundreds LSB (Counts). In your case it would be 399 what it quite high. Anyway it does not make sense to deal with accuracy without proper ADC calibration.