keypad using parallel out shift register and rpi

After checking the datasheet I see your problem. I thought the HC595 had open collector type outputs … it doesn’t. OC outputs allow to “wire AND” them together w/o causing a problem. Each output would supply either a hard ground w/a logic 0 or a soft pull-up to 5/3.3v w/a logic 1. Thus tying 2 or more outputs together is OK, any logic 0 results in all pins at ground voltage.

But your case is not that. You have active outputs, high and low states. Tying 2 outputs together and trying to have one be a logic 1 (5/3.3v) and the other be a logic 0 (0v) results in a “fight” and there’s no defined winner by spec. Tying more that 2 pins together just makes the situation worse, though apparently 2 logic 0’s win the fight vs a single logic 1 and results in a voltage low enough to be a considered a logic 0 by the input pin. And that’s what your circuit is doing when depressing multiple keys at the same time. Until the bit is shifted into one of the keys, they’re all at logic 0 voltage and that’s semi-OK. But when a logic 1 (5/3.3v) is shifted into any of the depressed keys, you’ve got a single 5/3.3v output tied to multiple 0v outputs. Not good. You need to switch an OC shift register or buffer these outputs.

http://www.evilmadscientist.com/2012/ba … r-outputs/

http://en.wikipedia.org/wiki/Open_collector