Floating readings on ADC0838
Sutton Murray
Posts: 88
Hi
I have my ADC0838 set up to read LM34 sensors and Theristors. On the debug screen every 2 seconds it will give me the list of taken reading from ch0 to ch7. With one·LM34 connected to ch0 and a theristor connected to·ch2 (thermistor connections as to·Tracy recomendation-circuit attached), with the DEC command used,·i started logging·reading·as follows.
cho0-79 measing 0.77 volts
ch2-08 measing·2.59 volts
With theristor in the kitchen oven at 200 degree celsius
ch2 got to 247, 4.95volts
Removing the theristor from the oven and still playing around
The channels readings started getting jumpy
ch0 80
ch1 0
ch2 103
ch3 0
ch4 128
ch5 0
ch6 64
ch7 128
This with only 2 sensors still connected
Even after removing all sensors and removing the power, also removed the ADC0838 from its socket
Values changed to
ch0 32
ch1 0
ch2 0
ch3 0
ch4 64
ch5 0
ch6 32
ch7 64
I have changed out the ADC0838 with 2 other spares IC i have. At times the readings returned to what it should look like, after i while it will again starts to get·jumpy. I can't seems to stop it from jumping for at leased a few hours. When it is working correctly i still don't know what i have done or why it is working as it should.
Why am i getting these results? I have tried·changing·the wiring on the pc boards power connections to the IC, i still had no luck.·I have attached the latest wiring connection(note in this way connected it sometimes works other·times jumping).·I have several other components on the one pc board, not shown on the·attached given circuit.
Please can someone help me?
I have my ADC0838 set up to read LM34 sensors and Theristors. On the debug screen every 2 seconds it will give me the list of taken reading from ch0 to ch7. With one·LM34 connected to ch0 and a theristor connected to·ch2 (thermistor connections as to·Tracy recomendation-circuit attached), with the DEC command used,·i started logging·reading·as follows.
cho0-79 measing 0.77 volts
ch2-08 measing·2.59 volts
With theristor in the kitchen oven at 200 degree celsius
ch2 got to 247, 4.95volts
Removing the theristor from the oven and still playing around
The channels readings started getting jumpy
ch0 80
ch1 0
ch2 103
ch3 0
ch4 128
ch5 0
ch6 64
ch7 128
This with only 2 sensors still connected
Even after removing all sensors and removing the power, also removed the ADC0838 from its socket
Values changed to
ch0 32
ch1 0
ch2 0
ch3 0
ch4 64
ch5 0
ch6 32
ch7 64
I have changed out the ADC0838 with 2 other spares IC i have. At times the readings returned to what it should look like, after i while it will again starts to get·jumpy. I can't seems to stop it from jumping for at leased a few hours. When it is working correctly i still don't know what i have done or why it is working as it should.
Why am i getting these results? I have tried·changing·the wiring on the pc boards power connections to the IC, i still had no luck.·I have attached the latest wiring connection(note in this way connected it sometimes works other·times jumping).·I have several other components on the one pc board, not shown on the·attached given circuit.
Please can someone help me?
pdf
14K
Comments
Then flip the 1.5V on and off to see if you get correct readings
Could you have capacitance holding the readings high or if you have a scope, is there excessive noise?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Metron9, i have connected the 1.5v battery to all channels all starting showning 128 on the debug screen. Switching each channel on and off works falling back between 0 and 128. But channels 4 to 6 did not fall back to 0 but between only to 2 to 8. channel 7 after a longer waiting period came back to 0.
I got my self a parallax scope now recently. But how to test for the excessive noise, i hope you can guide me through this.
EDIT>>>> Oops read the datasheet i see its microwire, I thought it read all 8 and then would send all 8 values at one time.
You do not have a problem on any of the pins with the exception of 4, 5 and 6.
Do a node check on all 8 input pins , Select a ground node, use the 1.5V static voltage on the inputs, program the chip to take one reading and hold, now check the voltages on each node. Also measure with no power on the circuit those same nodes from a common ground node. There has to be a difference in those pins or the serial communication between the chip and the stamp is not working correctly with a scope you can also check the timing of that aspect as well.
Basically finding noise is the voltage you see on the plot wil have a frequency of alternating voltage around the voltage you are measuring. Say you have a 5V signal and you see a fuzzy line bouncing between 5.2 and 4.8 volts you could have a large ground bounce. Make sure the battery is connected to the common ground when you test as well.
You must solve the pin 4,5 and 6 input problem with the static voltage before you can move on. Check your powersupply to the ADC chip as well for noise, (min and max voltage spikes)
I was looking at the datasheet again, I don't know if it matters but try switching your calculation of INITBITS to before you activate the chip so you can follow it with the address.
InitBits = %11000 | ((Channel & %001) << 2) | ((Channel & %110) >> 1)
LOW CS ' Activate the ADC0838
SHIFTOUT ADCIn,CLK,MSBFIRST,[noparse][[/noparse]InitBits\8]
SHIFTIN ADCOut,CLK,MSBPOST,[noparse][[/noparse]ADCRes\9]
' not sure what the delay between the last shift out bit and the start of reading but it must be more than 32us perhaps a delay of one statement before reading the output would insure adc is finished processing.
I am doing alot of guessing and throwing stuff on the wall just for ideas to jar the noggin into solving the problem.
many ideas may be way off base but may also cause one to think of another reason, when in doubt put everything on the table I say.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Post Edited (metron9) : 10/11/2006 9:24:22 PM GMT
2) The only anomaly in the program is that it's not clear whether you've connected the proper pins of the ADC0838 to the Stamp in the way your program expects. The comments (from the original) mention pins 0 through 3. You've got pins 8 through 11 and in a different order. There's no specific requirement for which pins are connected to what as long as CS on the ADC0838 is connected to the pin that the program expects and similarly for CLK, DI/ADCIn, and DO/ADCOut. I believe SE on the ADC0838 needs to be connected to +5V and that's not clear from your diagram.
As seen in my program the pins is not connected as in the the comments of the program. I have changed it as the made up board ended up using pins as used in my program. As far as i thought it was needed and as seen in my program i have changed the out and dirs commands to OUTD and DIRD . The voltages regulators have 0.1uF caps in my circuit. I have started over, made a complete new board with slight changed fitting the LM2940 in place of the LM7805 also another 0.1uF on the ADC. The 0.1uF i did try on my previous old board without any better results.
Now all channels is working fine. I thought that the reasons are due to the changes From the LM7805 to the LM2940. But out of what you have said this should not have the effect. I have not even tried the points mentioned by Metron9. So why is it working now?
Another question The circuit draws 0.04A, is this enough to let the LM7805 or as later fitted the LM2940 get very hot. I have no heatsink on this, as i thought that this is low current and a heat sink is not required. The LM gets so hot that you can't keep your fingers on it, is this normal? (Supply voltage is 16v at this stage). But will be used on 24v batterys.
·
·· The Voltage Regulator will get hot with almost no current draw at those high voltages (16V).· Once you go to 24V it will only get hotter.· The regulator has to dissipate the overhead as heat to regulate down to 5V.· A heat sink is recommended at those extremes.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
LM5009 - 150 mA, 100V Step-Down Switching Regulator
Here is a link to designing power supplys
http://www.national.com/appinfo/webench/power/SS/SS.cgi?flow=power&step=1A
Typically you don't want to drop more voltage than the output on a linear regulator.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Metron9, i like the link thanks. I will be working on this again