Digital Pot SPI Instructions.
Vitor
Posts: 13
I purchased a few digital pots to control the frequency of a sine wave generator and I did not realize (until I read the datasheet) that the digital pots I purchased use SPI interface, not what I was expecting.
This is what I got.
http://www.robotstore.com/download/241787.pdf
Does somebody have a sample of code to send the instructions to the digital pot?
I'm using a BS2 and I would like to connect 2 or more digipots to the same lines.
Thank you.
Post Edited (Vitor) : 1/27/2007 6:32:41 PM GMT
This is what I got.
http://www.robotstore.com/download/241787.pdf
Does somebody have a sample of code to send the instructions to the digital pot?
I'm using a BS2 and I would like to connect 2 or more digipots to the same lines.
Thank you.
Post Edited (Vitor) : 1/27/2007 6:32:41 PM GMT
Comments
No worries, SPI is fine for use with the PBASIC Stamp.
You use the SHIFTOUT instruction to set it or write to it, and the SHIFTIN instruction to read it (the EEPROM). The rest you can find in the PBASIC Reference Manual, or the PBASIC Help File, which also has some examples.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
However, there are some SPI bus devices that simultaneously send and receive data.
In those cases, you must "bit-bang" them.
Then I started looking for the digital pot to fit my circuit, 500K ohm, with 256 steps, SPI interface.
I can only find 1M ohm (no problem), 256 steps, I2C interface.
How is I2C different from SPI communication?
Do I use the same command? SHIFTOUT
Thanks in advance.