Can someone possibly explain to me why this code would not work? When I run it the digital pot does nothing.
Code:si var portb.2 sclk var portb.1 cs var portb.0 pot_value var byte data_word var word low sclk ' Set clock pin low high cs ' Set chip select low clear start: pot_value = pot_value + 1 data_word.byte0 = %00010001 ' Set write instruction to potentiometer 0 data_word.byte1 = pot_value ' Set potentiometer value to be written gosub shout goto start shout: low cs shiftout si,sclk,1,[data_word\16] ' Shift 16 bits out starting at bit0 high cs return




Bookmarks