A brief look at my circuit can be found at this link.


My code for this project is below, if loaded successfullly.

' serial out interface
'slow program for visual testing interface
'initialize ports

TRISB = 0 'set portb as output port
b0 var byte
pin0 var byte
start:
b0 = 128 'put number 128 ( 1000 0000) into b0
Gosub serial 'output the No. serially to 74ls164
'pause 1000 'wait 1 sec
b0 = 255 'Put No 255 (1111 1111) into b0
Gosub serial 'output the No. serially to 74ls164
'Pause 1000 'wait 1 sec
b0 = 0 'Put No. 0 (0000 0000) into b0
Gosub serial 'output the No. serially to 74LS164
'Pause 1000 'wait 1 sec
Goto start 'do it again

'serial out routine

serial:
pin0 = portb.7 'bring pin 0 high or low depending
'upon bits
Pulsout 1,1 'Bring CLK line high, then low
'pause 100 'same as above
pin0 = portb.6 'same as above
Pulsout 1,1 'same
'Pause 100 'same
pin0 = portb.5
Pulsout 1,1
'pause 100 'optional delay
pin0 = portb.4
Pulsout 1,1
'pause 100
pin0 = portb.3
Pulsout 1,1
'pause 100
pin0 = portb.2
Pulsout 1,1
'pause 100
pin0 = portb.1
Pulsout 1,1
'pause 100
pin0 = portb.0
Pulsout 1,1
'Pause 100
Low 1
Return