Multiple pot readings
hippy
Posts: 1,981
What's the easiest way to read multiple pots using a Propeller without going to external DAC hardware ?
I was thinking of a modified RCTIME circuit like below. A0..AN and Ax set low to discharge C via Rd. Then Ax input and one of A0..AN set high to charge C via Rc.
Any thoughts ? Any simpler ways ?
I was thinking of a modified RCTIME circuit like below. A0..AN and Ax set low to discharge C via Rd. Then Ax input and one of A0..AN set high to charge C via Rc.
Any thoughts ? Any simpler ways ?
VR Rc __/__ ____ A0 >----|_/___|----|>|----.----|____|----.------. / | | | : --|>|----{ | __|__ : --|>|----{ | --.-- __/__ | | | AN >----|_/___|----|>|----' | _|_ 0V / Rd | ____ | Ax <>--------------------------|____|----'
Comments
I don't know what I was thinking!
Actually, I think this could work!· You just measure the RC time it takes for the cap voltage to fall from Vdd to Vdd/2 by putting out a 0 on the pin you want to read and putting the others into high-impedance and reading the input there...· And, get rid of RC...
Post Edited (Rayman) : 10/16/2007 6:26:49 PM GMT
Simplification: As you can assure that A0 to AN are tristate (or also low) when unloading , you can completely ommit Rd as well as Rc.
I'll wire it up and see how it goes. Thanks for the suggestions.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
So Nick's suggestion is fine, buit any digital multiplexer with defined input threshold will do as well!
Edit: e.g. 74HC150 16:1 or 74HC152 8:1
There seems to be none with Schmitt Trigger inputs...
Post Edited (deSilva) : 10/16/2007 7:18:24 PM GMT
Ah, well. Not quite.
Use the 4051 to select the source to pass to the Cs and Rs. Just 4 more pins, one extra IC (the 4051) NOT more Cs and Rs and you get 16 channels. You even save some Rs and all the diodes.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Nick is right in his criticism, that when you want to load the cap through one of the Prop lines A0 to AN you will need an encoder with tri state output rather than a multiplexer.
I was somehow thinking to READ the voltage at A0 to AN which of course is nonsense!
Edit:
Hmm... seems such a chip does not exist Closest is a I2C port expander
Post Edited (deSilva) : 10/16/2007 7:53:20 PM GMT
Having enough I/O lines I'm happy to use them in parallel.
Post Edited (hippy) : 10/16/2007 7:56:53 PM GMT