be80be
Well-Known Member
This is totally untested but should head you in the right way It's just a start ok.
Code:
Device = 18F2420
Clock = 8
Config MCLRE = Off
Include "shift.bas"
Include "utils.bas"
Include "convert.bas"
Dim SDI As PORTB.1
Dim CLK As PORTB.2
Dim OE As PORTB.3
Dim LE as portb.4
Dim DataPin As SDI
Dim ClockPin As CLK
Dim ResetPin As OE
Dim index as byte
dim X as byte
const data(8)as Byte =(%00000001, %00000010, %000000100 ,%00001000, %00010000, %00100000, %01000000,%00111110)
sub StartScan()
LE = 0
ResetPin = 1
Shift.Out(LSB_FIRST, X, 8)
ResetPin = 0
LE = 1
end sub
Shift.SetOutput(DataPin)
Shift.SetClock(ClockPin)
output(ResetPin)
output(LE)
For index = 0 to bound (data)
X = (data(index))
StartScan
Next
End
Last edited: