digital potentiometer and constant voltage output
I need to set the output voltage from one of my pins to 0.6 V and at another pin at 3.3 V.· From what i've read so far it sounds like you can only set it high (5 volts) and low (0 volts) but nothing in between.··So now I'm·trying to interface a digital potentiometer to get the output voltage that I need, but i'm not sure how to write the code that will do this.· 'What's a Microctroller?' shows an example on how to adjust the voltage through the pot's whole range but not how to keep it steady at one set value without using the user input from the debug terminal.· Does anyone have any suggestions?
Comments
0.6 / 0.0196 = 30.6 (you should try 30 and 31 to see which is best for your app)
3.3 / 0.0196 = 168.3 (truncate to 168)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Cheers
The following statement doesn't make any sense to me: "if I'm using 0.6 volts out of one pin and 3.3 volts out of another, then I should have 5.1 volts left over (not counting whatever is needed for the stamp to operate), right?" What do you mean? The digital pot is in parallel with the power supply, but your comment suggests to me that you think it is in series.
There are digital pots that have many more available steps, and there are also digital pots that have internal memory that "remember" their setting, so that when you turn on the power it automatically comes back the the setting where you left it. Those usually have a SHIFTOUT or I2COUT interface, instead of increment/decrement.
The option of a DAC may be better for you.
The following messages have code for a couple of different 12 bit (4096 step) DACs...
MAX5722:
http://forums.parallax.com/forums/default.aspx?f=5&p=2&m=88071#m91143
TLV5618A:
http://forums.parallax.com/forums/default.aspx?f=5&p=2&m=88071#m93372
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com