I2C Problems communicating with DS3502 digital pot

Status
Not open for further replies.

tecnition_ted

New Member
Hi All, I am having problems getting any settings or reading from a DS3502. I have tried a simple test code to just read the pot wiper location to try and communicate with the device without success. All is ok if I use an Arduino so the picaxe should work ok.

Code:
setup:
hi2csetup i2cmaster,$50,i2cfast,i2cbyte

main:
i2cslave 0x50, i2cfast, i2cbyte
readi2c 0x00,(b0)
debug
PAUSE 1000
Goto main
Data sheet is here:

It looks simple, two registers 00h for the wiper setting and 02h for the mode.
I have set the address of the device to 50h by grounding both A1 and A2
I have tried 400khz and 100khz


If I can read the device then I should be able to send a write to set the wiper so far no luck reading with a Picaxe.

Can anyone see what I am doing wrong?

(sorry duplicate post put first one in finished projects)
 

neiltechspec

Senior Member
Why are you specifying i2cslave in main when you have i2c master in setup ??

Code:
#picaxe 08m2
#no_data

setup:
hi2csetup i2cmaster,$50,i2cfast,i2cbyte

main:
hi2cin 0,(b0)
sertxd (#b0,cr,lf)
pause 1000
goto main
 
Status
Not open for further replies.
Top