Here is the latest code bit:
define osc 4
CMCON = 7
TRISA = %11111111
TRISB = %00000000
PB0 VAR PORTB.0
PB1 VAR PORTB.1
PB2 VAR PORTB.2
PB3 VAR PORTB.3
SW0 VAR PORTA.0
SW1 VAR PORTA.1
SW2 VAR PORTA.2
SW3 VAR PORTA.3
SCAN:
If SW0 = 1 then
HIGH PB0:PAUSE 2000
ELSE
LOW PB0
ENDIF
If SW1 = 1 then
HIGH PB1:PAUSE 2000
ELSE
LOW PB1
ENDIF
If SW2 = 1 then
HIGH PB2:PAUSE 2000
ELSE
LOW PB2
ENDIF
If SW3 = 1 then
HIGH PB3:PAUSE 2000
ELSE
LOW PB3
ENDIF
HIGH PORTB.5
PAUSE 20
LOW PORTB.5
PAUSE 20
GOTO SCAN
I added the portb.5 so I could flash an LED to indicate the loop is running, which it does.
Still have no ouput on portb.0 to portb.3. The porta inputs are tied high with 10K resistors to +5v
Bookmarks