I'm trying to use the MCP4231-104 7bit digital potentiometer to make an LED get dimmer and brighter. That's not my ultimate goal with the digipot, but I'm just trying to make it do something basic before moving on. I'm using the PIC16F676 for the MCU. CS is connected to PORTC.0, SDO is connected to PORTC.1, and SCK is connected to PORTC.2
Main:
PORTC.0 = 0
SHIFTOUT PORTC.1, PORTC.2, 1, [0\7]
PORTC.0 = 1
PAUSE 100
PORTC.0 = 0
SHIFTOUT PORTC.1, PORTC.2, 1, [64\7]
PORTC.0 = 1
PAUSE 100
PORTC.0 = 0
SHIFTOUT PORTC.1, PORTC.2, 1, [128\7]
PORTC.0 = 1
PAUSE 100
PORTC.0 = 0
SHIFTOUT PORTC.1, PORTC.2, 1, [64\7]
PORTC.0 = 1
PAUSE 100
goto main
end
This isn't doing anything. I've also tried enter the shiftout bits as binary, but I get the error msg "Malformed Binary Integer".
Bookmarks