I'm having problems with the DS1803 010 (10Kohm) digital pot.
This is simply a test circuit - ultimately I'd like to use the device to alter the brightness of a LED. Problem is, the simple circuit doesn't work. I have a feeling it may be an address issue. Any help from those more experienced would be greatly appreciated!
code and circuit diagram;
Code:
Button1 var portb.7 ' low is pressed
led1 var portb.6
SDA VAR portc.2
SCL VAR portc.3
B0 var word
LOOP:
'***************** VARY POT OVER RANGE **********************
FOR B0 = 1 TO 255
I2CWRITE SDA, SCL, %01010000, %10101111, [B0]
PAUSE 10 ' Wait =>10 mS for write to complete
IF B0 = 255 THEN LOOP
NEXT B0
'************************************************************
GOTO LOOP
end
Bookmarks