Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Wiring Pi shift register 74HC595

Thu May 07, 2015 4:51 pm

I use Wiring Pi to control the Gpio ports of my raspberry pi from the command line and in some bash scripts.
Now i run out of Gpio ports, and want to use a Shift register(s). Is this possible with Wiring Pi in the command line and bash?
Type shift registers: 74HC595

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden
Contact: Website

Re: Wiring Pi shift register 74HC595

Fri May 08, 2015 8:29 pm

Yes, the gpio utility that comes with wiringPi can use the sr595 extension.
http://wiringpi.com/the-gpio-utility/th ... extension/
--
Ragnar

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Wiring Pi shift register 74HC595

Sun May 10, 2015 1:16 pm

Thnx!

From the website.
The only function this module supports is write.
I have a quiz project in mind. 4 buttons A,B,C,D as input. Possible with only the write function?

Examples:

gpio -x sr595:100:8 write 100 1
gpio -x sr595:100:8 write 101 1
gpio -x sr595:100:8 write 100 0

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden
Contact: Website

Re: Wiring Pi shift register 74HC595

Sun May 10, 2015 1:35 pm

The 74x595 chip only has outputs, so it stands to reason that it only has a write function.
It should be possible to use those outputs as inputs, though.
This video explains the principle: https://www.youtube.com/watch?v=nXl4fb_LbcI

Maybe you would be better served by an I2C GPIO extender, like the MCP23008 or MCP23017 chips?
http://www.raspberrypi-spy.co.uk/2013/0 ... pi-part-1/
http://wiringpi.com/the-gpio-utility/i2 ... xtensions/
--
Ragnar
Last edited by ragnarjensen on Sun May 10, 2015 5:13 pm, edited 1 time in total.

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Wiring Pi shift register 74HC595

Sun May 10, 2015 4:32 pm

Ragnar,

Thnx! I need input yes, not output :)

Is this a correct one? http://www.ebay.com/itm/5pcs-MCP23017-E ... 2ed7f02de7

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden
Contact: Website

Re: Wiring Pi shift register 74HC595

Sun May 10, 2015 5:09 pm

Yes, that one will give you 16 inputs/outputs.
--
Ragnar

User avatar
mikronauts
Posts: 2817
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Wiring Pi shift register 74HC595

Sun May 10, 2015 5:43 pm

Those are the correct chips!

If you want to save some work, take a look at the board I designed for using them with the Pi:

http://www.mikronauts.com/raspberry-pi/pi-rtc-dio/

Note that it is supplied as a kit, so you would have to solder it together yourself - but it is a tested known to work design/board.

FYI, you can stack four on one Pi, for a maximum of 128 I/O's that can be either input or output.
Piminiuser wrote:Ragnar,

Thnx! I need input yes, not output :)

Is this a correct one? http://www.ebay.com/itm/5pcs-MCP23017-E ... 2ed7f02de7
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Wiring Pi shift register 74HC595

Mon May 11, 2015 1:40 pm

Thnx for al the answers! i just bought from my ebay link.
Now i must wait 3/4 weeks before they arrive :(

Return to “Interfacing (DSI, CSI, I2C, etc.)”