<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>74HC595: Build a Keyboard/Keypad/Joypad and more!</title><link>/products/raspberry-pi/raspberrypi_projects/b/blog/posts/74hc595-build-a-keyboard-keypad-joypad-and-more</link><description>Table of Contents

 Introduction 
 74HC595 Explained 
 Circuit 
 Code 
 LED Bonus 
 Building It 


Introduction
A while back, I attached a 4x4 keypad matrix to a microcontroller, and it took up eight GPIO inputs. This time around, I noticed I had a load</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: 74HC595: Build a Keyboard/Keypad/Joypad and more!</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/74hc595-build-a-keyboard-keypad-joypad-and-more</link><pubDate>Tue, 20 Oct 2026 02:23:45 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b38144e4-e723-443b-8c88-b22e53ef33d6</guid><dc:creator>shabaz</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Poor probing, but a quick test to see how long the scan takes. This is the SR_CLK signal, and &amp;#39;scope is set to 2 usec per division. As can be seen, the first 16 pulses (which perform the button-scan occupy just under 9 usec. After that, the remaining 3 usec or so are occupied with the LED driver pulses (8 pulses with the LED data, and then 16 more pulses to continue to push the LED data to that last shift register).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="492" src="/resized-image/__size/1820x984/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-b38144e4-e723-443b-8c88-b22e53ef33d6/without_2D00_usb_2D00_uart_2D00_annotated.png" width="910" /&gt;&lt;/p&gt;
&lt;p&gt;The above is repeatable, but, more realistically, when USB is enabled (which is normal with the Pico, since stdio input/output can be channelled through USB), then the USB code can interrupt any time, and then the SR_CLK trace looks like this (&amp;#39;scope is set to 5usec per division), and the time becomes variable, sometimes stretching to about 25-30 usec:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="468" src="/resized-image/__size/1966x936/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-b38144e4-e723-443b-8c88-b22e53ef33d6/with_2D00_usb_2D00_uart.png" width="983" /&gt;&lt;/p&gt;
&lt;p&gt;Of course, both these values are very small, but you can see where the areas would be to make improvements (for instance, a lower value resistor would allow less nop() delay during the button scan, hence reducing from 9usec to perhaps 4 or 5 usec.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=30326&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: 74HC595: Build a Keyboard/Keypad/Joypad and more!</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/74hc595-build-a-keyboard-keypad-joypad-and-more</link><pubDate>Mon, 19 Oct 2026 21:16:50 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b38144e4-e723-443b-8c88-b22e53ef33d6</guid><dc:creator>geralds</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Shabaz &amp;nbsp;[mention:b0bc65b9ecdc4307bd967592f00e340a:e9ed411860ed4f2ba0265705b8793d05]&amp;nbsp;!&lt;/p&gt;
&lt;p&gt;Nice circuit. &amp;quot;The running 1&amp;quot;or (&amp;quot;0&amp;quot;)...&lt;/p&gt;
&lt;p&gt;I made such circuit with the keypad encoder MM74C922 (16keys), or xx923 (20keys).&lt;/p&gt;
&lt;p&gt;[View:/cfs-file/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-b38144e4-e723-443b-8c88-b22e53ef33d6/MM74C922_2C00_923.pdf:640:360]&lt;/p&gt;
&lt;p&gt;With this encoder you just need 1 IC. The outputs are 3-state, so you can connect it directly on a data bus.&lt;br /&gt;With a few logic gates you can expand the keypad matrix.&amp;nbsp;&lt;br /&gt;This is a very old device. Maybe you have one in your box.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=30326&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>