I am trying to read 4 BCD Thumbwheels and I need 16 inputs. I am playing with the 74HC165 Shift Register.
As I am just learning the to use the picaxe I need some help gettng started.
I found an old Basic Stamp code I am tring to convert to use with my 40X1 chip.
http://www.parallax.com/dl/docs/books/sw/exp/sw24b.pdf
When I run the code I get a firmware error.
Can someone help me get this code working?
See the attached pic.
'Read 8 bits from 74HC165 Shit Register into 40X1
'program to be expanded to read 16 inputs with 2 shift registers
'Outputs
Symbol Load = 1 'Connected to Pin 2 of 74HC165
Symbol sClock = 0 'Connected to Pin 0 of 74HC165
'Inputs
Symbol sdata = b.7 'Connected to Pin 7 of 74HC165
Main:
High Load
gosub read165
Debug B1
Pause 100
goto main
read165:
pulsout load, 5
shiftin sClock,sdata,MSBPre_H, (b1 / 8) ‘ clock 8 bits into b1
return
As I am just learning the to use the picaxe I need some help gettng started.
I found an old Basic Stamp code I am tring to convert to use with my 40X1 chip.
http://www.parallax.com/dl/docs/books/sw/exp/sw24b.pdf
When I run the code I get a firmware error.
Can someone help me get this code working?
See the attached pic.
'Read 8 bits from 74HC165 Shit Register into 40X1
'program to be expanded to read 16 inputs with 2 shift registers
'Outputs
Symbol Load = 1 'Connected to Pin 2 of 74HC165
Symbol sClock = 0 'Connected to Pin 0 of 74HC165
'Inputs
Symbol sdata = b.7 'Connected to Pin 7 of 74HC165
Main:
High Load
gosub read165
Debug B1
Pause 100
goto main
read165:
pulsout load, 5
shiftin sClock,sdata,MSBPre_H, (b1 / 8) ‘ clock 8 bits into b1
return
Attachments
-
100.9 KB Views: 23