|
||||||||
|
||||||||
|
AAN140 Interface to a 74HC165 Shift Register and gain input ports By Michael Simpson Using the 74HC595 we were able to add some output ports. Now lets add a few input ports. we will use the 74HC165 shift register. The process is pretty easy on the Athena because we have a command just for talking to a 74HC165 chip. srin You supply the three interface leads and it will read all 8 ports into the supplied variable.
Schematic Schematic 1
Very simple program. It will read the ports and diplay them in a single value. Each port represents a single bit.
Now lets take it one step further. The Athena has a command called srinport. This command will read an individual port from the shift register. Program 2 'srinport demo In the above example x is the actual port you want to read.
Going further You can share the load and clock leads if you want to connect to multiple shift-in registers. Parts
|
Copyright © 2001 - 2007 Kronos Robotics