Go Down

Topic: Need some advice on a Digital Potentiometer (Read 12272 times) previous topic - next topic


Haha I took a look at page 47, and it is complete gibberish to me.  I don't get why there are numbers and letters all in that chart!

Maybe if I randomly put high voltage into it the magic smoke will solve my problems ;D.


Apr 22, 2010, 04:18 am Last Edit: Apr 22, 2010, 04:32 am by Osgeld Reason: 1
ok I think I understand it ok, but I have no idea if this simplification works

replace the commandByte with

00000000 to write to pot 2
00010000 to write to pot 1

the first 4 bits are a register address 0 pot 0 and 1 pot 1,  2 & 3 are reserved, 4 is the terminal connector register, where you can connect and disconnect individual pins of each pot and control its behaviour on a shutdown signal (page 36), 5 is the status register to read if something is in a shutdown state the rest are reserved

bits 5 & 6 are the command bits (page 47)

11 Read Data 16-Bits
00 Write Data 16-Bits
01 Increment 8-Bits
10 Decrement 8-Bits

and 7 & 8 are data bits, and this is where I get confused

if you want to send a 8 bit command you can use the inc / dec functions above to (I presume) jump a few steps at a time

if you send it a 2 byte command, you now have 10 data bits, BUT the msb (bit 7 of byte 1) is not used for input, the next bit (bit 8 of byte 1) I think sets it into "normal" or "full scale" modes followed by the real data (byte 2)


edit :: also look at the table on page 48, only look at function, command, and SDI pin


Wow I'm even more confused now haha.  I'll get some sleep and start experimenting tomorrow once I'm more rested :).




Apr 22, 2010, 09:25 pm Last Edit: Apr 22, 2010, 10:30 pm by Tchnclfl Reason: 1
Well, I don't know how you did it, but those commands magically work!  Thanks a ton!

Any chance of a command to write to both pots?  I've noticed that when you write to one, the other seems to reset (to 127).

[edit]Actually, it turns out I can send them both commands to write a value, but I have to do it seperately, and Pot1 doesn't seem to be quite right (seems to skip about half of the commands).[/edit]

[edit]Nevermind, all is good now!  Almost done with the library![/edit]

Go Up