ADC 0838 vs ADC 0834
Branmuffin Industries
Posts: 35
Hey everyone,
Last month I put together a circuit on a prop proto board that hooks up an ADC 0834 four-channel Analog to digital converter. I found an object in the object exchange (CD_ADCO834) and got it working with a graphics / TV object. I would spin a potentiometer knob and an "analog gauge style" line would rotate on the screen.
Now I am building an application where I use an ADC 0838. I remember having one of these back in the day and never getting it to work. I wired it up as indicated, and tried the ADC0838_Debug object in the object exchange but it does not seem to work for me. Tried also modifying the ADC0834 code to handle another bit in the data in stream... To no avail.
Trouble is, it's very hard to debug because you download the program and turn your potentiometer and nothing draws, and you have no idea if its because of a software problem or a wiring /hardware issue. I've got Data In and Data Out tied together, and by some magic it seems to work without conflict on the ADC 0834... especially because no where in the code is the DI/DO I/O pin switching from input to output and back again. I resisted the DI/DO line and SARS line with 1k resistors, and the CLK and CS lines are straight from prop IO to the ADC chip.
I can't seem to understand what the purpose of the SARS line is, anyway. It has something to do with whether or not you send the serial stream LSB or MSB, right?
This last part is the lynchpin to my whole program... Tragically the ADC 0838 don't get along !
-Ryan Brandys
Last month I put together a circuit on a prop proto board that hooks up an ADC 0834 four-channel Analog to digital converter. I found an object in the object exchange (CD_ADCO834) and got it working with a graphics / TV object. I would spin a potentiometer knob and an "analog gauge style" line would rotate on the screen.
Now I am building an application where I use an ADC 0838. I remember having one of these back in the day and never getting it to work. I wired it up as indicated, and tried the ADC0838_Debug object in the object exchange but it does not seem to work for me. Tried also modifying the ADC0834 code to handle another bit in the data in stream... To no avail.
Trouble is, it's very hard to debug because you download the program and turn your potentiometer and nothing draws, and you have no idea if its because of a software problem or a wiring /hardware issue. I've got Data In and Data Out tied together, and by some magic it seems to work without conflict on the ADC 0834... especially because no where in the code is the DI/DO I/O pin switching from input to output and back again. I resisted the DI/DO line and SARS line with 1k resistors, and the CLK and CS lines are straight from prop IO to the ADC chip.
I can't seem to understand what the purpose of the SARS line is, anyway. It has something to do with whether or not you send the serial stream LSB or MSB, right?
This last part is the lynchpin to my whole program... Tragically the ADC 0838 don't get along !
-Ryan Brandys
Comments
the end of your post sounds like you have given up.
if you did not give up please make a new posting with very CONCRETE questions
and attach your sourcecode
i think it would be useful to use a simpler displaymethod than the drawing line.
f.e. sending characters to a terminalsoftware. For debugpurposes you should add
sending debugstrings to the terminalsoftware inside the SPIN-Sourcecode to analyze if there is an error in the
received datastream of the ADC
did you check if these chips use EXACTLY the same protocoll for transmitting the data
from the ADC-Chip to the propeller?
regards
Stefan
http://web.bii.a-star.edu.sg/~james/a2d_box/
http://web.bii.a-star.edu.sg/~james/a2d_box/program.bs2
Will keep you guys posted on the progress and hopefully have an object to share when its all over.
-Ryan
I tried the BS2 code but it didn't seem to work. I used its wiring diagram as a starting point, and hooked up the propeller using four I/O pins: _cs, clk, dinout, and sars.
Modifying the CD_0834 code, I came up with an ADC0838 object that almost works. Here's the problem:
I set up eight potentiometer knobs between 0 and 5 v, and hooked those to the eight analog inputs of the ADC0838.
I used a very basic graphics / TV object to write to the screen the values it receives from all eight channels of the ADC. these are on eight separate lines of text on the screen, each with a 0-255 number and some text.
When I rotate each knob, the value on the screen flutters 0 , 255, 0, 254, 0, 255, etc. No values in between show up, just 0 or 255. But the fact that I can get each knob to individually influence its corresponding line on the screen means I have communication between the prop and ADC somewhat working.
My first thought was the Data In/Out pin was not switching back to an input, but i checked and it flips between input and output as needed. The code in that section has not changed from the ADC0834, which worked fine.
Is this a hardware issue ? perhaps I need a larger or smaller resistor on my Din/Dout line?
Is this a software issue? perhaps the way I interpret the SARS value is wrong and i'm grabbing the wrong part of the data stream..
So close on this one I can taste it...
-Ryan Brandys
I have posted the object in the new and improved object exchange as RB_ADC0838.spin !
-Ryan Brandys
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······
······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet
········