Modify the MCP3208 Object...?
jeff-o
Posts: 181
Hey everyone, I'd like to use the MCP3208 object from the OBEX (programmed by Chip himself!) The problem is that my custom board uses separate pins for DOUT and DIN, while the object uses a single pin for both. Is there any way to modify the code to use separate pins?
Here's the object: http://obex.parallax.com/objects/180/
Here's the object: http://obex.parallax.com/objects/180/
Comments
it uses different pins
I tried hacking the object you refered to before I saw Thric's post. His is probably a better method of doing this.
I made a very ugly hack of Chip's beautiful code. I haven't tried it myself, (famous last words) but my limited understanding of PASM is telling me it should work.
Just change the number of left shifts of the variable dInOnly to the pin number of your data in pin.
I'll try to find one of my MCP3208s to try this on.
I feel like I just put a crayon mustache on the Mona Lisa.
Duane
I wired up a MCP3208. It works fine with Chip's object but I get zeros with mine.
If I get it to work, I'll post an update. But don't hold your breath.
Duane
The code I posted does work! Wow, I'm a genius! (that was sarcasm)
I had my data lines switched. The dInOnly pin is connected to the ADC data out pin. (How many times am I going to get rx and tx switched?)
So if you're willing to hard code the pin number connected to the data out on the ACD then the code I posted should work.
I'm so relieved to know I understand PASM as much as I thought I did.
Duane
Fantastic! I'll take it for a spin right away and let you know how it goes.