{"id":246,"date":"2017-05-27T16:54:05","date_gmt":"2017-05-27T21:54:05","guid":{"rendered":"http:\/\/www.millamilla.com\/?p=246"},"modified":"2018-03-19T13:29:48","modified_gmt":"2018-03-19T18:29:48","slug":"testing-sn74hc595-shift-register-with-bus-pirate","status":"publish","type":"post","link":"https:\/\/www.millamilla.com:443\/?p=246","title":{"rendered":"Testing SN74HC595 shift register with Bus Pirate"},"content":{"rendered":"<p>As part of the <a href=\"https:\/\/contextualelectronics.com\/courses\/micro-breakout-header\/\">CE Header<\/a> project from the <a href=\"http:\/\/skills.contextualelectronics.com\/\">CE Skills<\/a> course , we have a <a href=\"http:\/\/www.ti.com\/lit\/ds\/symlink\/sn74hc595.pdf\">shift register<\/a> on the\u00a0SensorBoard. This chip allows us to light up 8 LEDs ( more with chip chaining ) with 3 pins. \u00a0I used a Bus Pirate (Dangerous Prototypes) and probes, from Seeed Studio, to iteratively poke at it until I understood how to talk to it via SPI.<\/p>\n<p>I used a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Dual_in-line_package\">DIP<\/a> version of the chip in a\u00a0breadboard and wired it up to the Bus Pirate. \u00a0The LEDs are in the breadboard to see it working. Please note, the cable and connectors in the image below are from the Seeed probe cable. Some of the other probe cables have the colors in a different order on the connectors.<\/p>\n<p>I used <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\">putty<\/a> to connect to the Bus Pirate via a mini usb cable.<\/p>\n<p><strong>Note<\/strong>: If you decide to hook this up to an Arduino for testing, using an example <a href=\"https:\/\/www.arduino.cc\/en\/Tutorial\/ShftOut12\">sketch<\/a>, here are the pins to use for your reference:<\/p>\n<p style=\"padding-left: 30px;\">BP MOSI=pin 11<br \/>\nBP CLK=pin 12<br \/>\nBP CS=pin 8<\/p>\n<table style=\"width: 391px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"0\">\n<thead>\n<tr>\n<td style=\"width: 86px;\">Command<\/td>\n<td style=\"width: 295px;\">What it does<\/td>\n<\/tr>\n<\/thead>\n<caption>Initalize the Bus Pirate<\/caption>\n<tbody>\n<tr>\n<td align=\"left\">M 5 1 1 2 1 2 2<\/td>\n<td>\n<ul>\n<li>Mode SPI<\/li>\n<li>Speed 30khz<\/li>\n<li>Clock: Idle low *default<\/li>\n<li>Output clock edge: Active to idle *default<\/li>\n<li>Input sample phase: Middle *default<\/li>\n<li>CS: \/CS *default, Output Type: Normal (H=3.3V, L=GND)<\/li>\n<\/ul>\n<p>Make sure the mode number you use is for SPI<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 86px;\">W<\/td>\n<td style=\"width: 295px;\">Turn on power, don&#8217;t forget this. \u00a0If you try to access the FRAM chip before this, you will likely hang the Bus Pirate and have to unplug\/plug,setup.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 778px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"0\">\n<thead>\n<tr style=\"height: 25px;\">\n<td style=\"width: 155px; height: 25px;\">Command<\/td>\n<td style=\"width: 144px; height: 25px;\">What it does<\/td>\n<td style=\"width: 483px; height: 25px;\">Output<\/td>\n<\/tr>\n<\/thead>\n<caption>Turn on output pins<\/caption>\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 155px; height: 24px;\">[ 0b00000001 ]<\/td>\n<td style=\"width: 144px; height: 24px;\">Turn on LEDs. \u00a0Bit 1 is QA and bit 8 is QH.<\/td>\n<td style=\"width: 483px; height: 24px;\">\n<table border=\"1\">\n<tbody>\n<tr>\n<td>QH<\/td>\n<td>QG<\/td>\n<td>QF<\/td>\n<td>QE<\/td>\n<td>QD<\/td>\n<td>QC<\/td>\n<td>QB<\/td>\n<td>QA<\/td>\n<\/tr>\n<tr>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-253 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_on.png\" alt=\"\" width=\"102\" height=\"124\" \/><\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 155px; height: 24px;\">[ 0b10000000 ]<\/td>\n<td style=\"width: 144px; height: 24px;\">Turn on LEDs<\/td>\n<td style=\"width: 483px; height: 24px;\">\n<table border=\"1\">\n<tbody>\n<tr>\n<td>QH<\/td>\n<td>QG<\/td>\n<td>QF<\/td>\n<td>QE<\/td>\n<td>QD<\/td>\n<td>QC<\/td>\n<td>QB<\/td>\n<td>QA<\/td>\n<\/tr>\n<tr>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-253 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_on.png\" alt=\"\" width=\"102\" height=\"124\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 155px; height: 24px;\">[ 0b10101010 ]<\/td>\n<td style=\"width: 144px; height: 24px;\">Turn on LEDs<\/td>\n<td style=\"width: 483px; height: 24px;\">\n<table border=\"1\">\n<tbody>\n<tr>\n<td>QH<\/td>\n<td>QG<\/td>\n<td>QF<\/td>\n<td>QE<\/td>\n<td>QD<\/td>\n<td>QC<\/td>\n<td>QB<\/td>\n<td>QA<\/td>\n<\/tr>\n<tr>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-253 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_on.png\" alt=\"\" width=\"102\" height=\"124\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-253 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_on.png\" alt=\"\" width=\"102\" height=\"124\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-253 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_on.png\" alt=\"\" width=\"102\" height=\"124\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-253 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_on.png\" alt=\"\" width=\"102\" height=\"124\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 155px; height: 24px;\">[ 0b00000000 ]<\/td>\n<td style=\"width: 144px; height: 24px;\">Turn all LEDs off<\/td>\n<td style=\"width: 483px; height: 24px;\">\n<table border=\"1\">\n<tbody>\n<tr>\n<td>QH<\/td>\n<td>QG<\/td>\n<td>QF<\/td>\n<td>QE<\/td>\n<td>QD<\/td>\n<td>QC<\/td>\n<td>QB<\/td>\n<td>QA<\/td>\n<\/tr>\n<tr>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/led_off.png\" alt=\"\" width=\"76\" height=\"114\" \/><\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Looking from the right side<br \/>\n<a href=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_R_2-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-250\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_R_2-1-300x225.jpg\" alt=\"\" width=\"600\" height=\"450\" srcset=\"https:\/\/www.millamilla.com:443\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_R_2-1-300x225.jpg 300w, https:\/\/www.millamilla.com:443\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_R_2-1-768x576.jpg 768w, https:\/\/www.millamilla.com:443\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_R_2-1-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Looking from the left<br \/>\n<a href=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_L.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-249\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_L-300x225.jpg\" alt=\"\" width=\"600\" height=\"450\" srcset=\"https:\/\/www.millamilla.com:443\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_L-300x225.jpg 300w, https:\/\/www.millamilla.com:443\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_L-768x576.jpg 768w, https:\/\/www.millamilla.com:443\/wp-content\/uploads\/2017\/05\/connect_buspirate_sn74hc595_L-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of the CE Header project from the CE Skills course , we have a shift register on the\u00a0SensorBoard. This chip allows us to light up 8 LEDs ( more with chip chaining ) with 3 pins. \u00a0I used a Bus Pirate (Dangerous Prototypes) and probes, from Seeed Studio, to iteratively poke at it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-246","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/posts\/246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=246"}],"version-history":[{"count":7,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/posts\/246\/revisions"}],"predecessor-version":[{"id":278,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/posts\/246\/revisions\/278"}],"wp:attachment":[{"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}