Made my protoboard and finaly found the code for assinging port pins.
DEFINE OSC 4
TRISB = %00000000
x var byte
Leds var byte
Digs var byte
ENABLE DEBUG
main:
for x = 0 to 9
leds = x
Digs = x
GOSUB PORTSsegments
gosub PORTSdiggits
Pause 500 ' Delay for .5 seconds
leds = %0000
Digs = %0000
GOSUB PORTSsegments
gosub PORTSdiggits
Pause 500 ' Delay for .5 seconds
next x
Goto main ' Go back to loop and blink LED forever
PORTSsegments:
PortB.0 = leds.0 : PortB.1 = leds.1 : PortB.2 = leds.2 : PortB.3 = leds.3
return
PORTSdiggits:
PortB.4 = Digs.0 : PortB.5 = Digs.1 : PortB.6 = Digs.2 : PortB.7 = Digs.3
return
DISABLE DEBUG
End
Bookmarks