A to D conversion is going wrong

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

A to D conversion is going wrong

2,680 次查看
pbol
Contributor I
I am using a S08AW32 microcontrel with 7 pinconfigured as Analog to digital channels.
I am sensing different level on these pins and everything seems cleans most of the time. An external IC sends me T° another gives me pressure in a bootle and  a third one a level in this bootle.
The "strange think" is that sometine and for a variable amout of time (very short time to 30 s) all the mesureament given by AD converter seems to be double :
For example T° is 25 °C  P is 50   L is 10 in normal condition and then
T° is 50 °c (a value that my Ic can not give)
P is 70 (in that means My AD channel give FF in 8 bit mode P=50 is near the maximum)
L is 20
 
The AD conversion is setup by PE beans with 8 values average asynchronous clock and software continious operation (interrupt by COCO bit)
 
Any suggestion ? Hardware troubles ? software troubles ?
 
Thanks
标签 (1)
0 项奖励
回复
5 回复数

1,326 次查看
allawtterb
Contributor IV
Have you looked at the voltage level of these lines on an Oscope when you are getting these readings?
0 项奖励
回复

1,326 次查看
pbol
Contributor I
For scope unfortunatly I did not succedded to reproduce the troubles even with strong inrush current on main power supply or EMC perturbation. What I have seen it that th board design is poor in term of power supply filtering and One big point is that Digital supply and analog supply do not come from the same line (2 different 5V regulator) so I check result if VDD>VDA and VDA > VDD (test with value far from Absolute maximum rating) and everything is clean !!
 
I use 10 bit mode but on the datasheet the 6 high bit of MSB seem to be set at 0 , is there something wrong ?
 
I am using the PWM function and I saw that there is an errata mask about it. It does not seem to affect AD conversion ?
 
In fact if I could manage to reproduce the trouble I think I could find the solution. Do you have any suggestion to put AD in trouble ??!!!
 
Thanks for help
 
0 项奖励
回复

1,326 次查看
Denn
Contributor I
Hello,


pbol wrote:
 
I use 10 bit mode but on the datasheet the 6 high bit of MSB seem to be set at 0 , is there something wrong ?
 

It is supposed to return 0 in 6 high bits of MSB, but sometimes it may return some random values,maybe because of reserved/unimplemented high 6 bits.
 
 
Also refer the thread.
 
Regards,
Denn.
0 项奖励
回复

1,326 次查看
pbol
Contributor I
To all
I finally discover what was going wrong with my design, It has no thing rely to freescale or code. I give the explanation for knowledge.
The micro is powered with VDD = 5V from a ad/dc power supply. Vda and vrefa are made from another power supply (from 12V DC down converted by a linear regulator ). I have previously test big difference (+/- 1V) between these two 5V supply and nothing occured, but if VDD is getting down bellow 4V and the analog part (Vda and Vrefa) stayed at 5V then all the AD chain is going wrong. The main power supply (VDD) was dropping down erraticaly bellow 4V and the LVDS system was set to 2.5V. So every thing seems ok but AD conversion was wrong.
So the trouble was using the micro out of spec (even the design was correct) !!!
 
thank for people who tryed to help me
 
0 项奖励
回复

1,326 次查看
Denn
Contributor I
Hello,
 
What is the resolution of ADC.8 bit or 10 bits ? If its 10 bit then read only 10 bits of ADC register by logical ANDing ADCR with 0x03FF.This is required because the Higher byte of ADCR has some reserved bits which sometimes gives random undocumented values.
 
If you are not using digital averaging filter of read ADC values, then I would suggest you adopt it as it smoothens any sudden change(spurious) in the analog input.
 
Regards,
Denn.
0 项奖励
回复