Page 1 of 1

Wiring Pi shift register 74HC595

Posted: Thu May 07, 2015 4:51 pm
by Piminiuser
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

Re: Wiring Pi shift register 74HC595

Posted: Fri May 08, 2015 8:29 pm
by ragnarjensen
Yes, the gpio utility that comes with wiringPi can use the sr595 extension.
http://wiringpi.com/the-gpio-utility/th ... extension/
--
Ragnar

Re: Wiring Pi shift register 74HC595

Posted: Sun May 10, 2015 1:16 pm
by Piminiuser
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

Re: Wiring Pi shift register 74HC595

Posted: Sun May 10, 2015 1:35 pm
by ragnarjensen
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

Re: Wiring Pi shift register 74HC595

Posted: Sun May 10, 2015 4:32 pm
by Piminiuser
Ragnar,

Thnx! I need input yes, not output :)

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

Re: Wiring Pi shift register 74HC595

Posted: Sun May 10, 2015 5:09 pm
by ragnarjensen
Yes, that one will give you 16 inputs/outputs.
--
Ragnar

Re: Wiring Pi shift register 74HC595

Posted: Sun May 10, 2015 5:43 pm
by mikronauts
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

Re: Wiring Pi shift register 74HC595

Posted: Mon May 11, 2015 1:40 pm
by Piminiuser
Thnx for al the answers! i just bought from my ebay link.
Now i must wait 3/4 weeks before they arrive :(