{"id":534,"date":"2009-05-28T01:56:47","date_gmt":"2009-05-28T06:56:47","guid":{"rendered":"http:\/\/www.tigoe.net\/pcomp\/code\/?p=534"},"modified":"2010-03-23T19:45:40","modified_gmt":"2010-03-24T00:45:40","slug":"st16c596-shift-register","status":"publish","type":"post","link":"https:\/\/www.tigoe.com\/pcomp\/code\/arduinowiring\/534\/","title":{"rendered":"STP16C596 Shift Register"},"content":{"rendered":"<p>This tutorial will show how to control multiple LED outputs from a microcontroller using an STP16C596 shift register.  The STP16C596 is similar to the popular 74HC595 shift register, but it&#8217;s nicer because it can sink a constant current to the LEDs it&#8217;s driving. It works slightly differently, however, so this code won&#8217;t work exactly for the &#8216;595.<\/p>\n<p>This is a stub. More explanation will follow, but for now, here are schematics and code for Arduino.<\/p>\n<p>Parts you&#8217;ll need:<\/p>\n<ul>\n<li>STP16C596 shift register<\/li>\n<li>Arduino microcontroller<\/li>\n<li>LEDs<\/li>\n<li>1-kilohm resistor<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h2>The Circuit<\/h2>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>\n<p><figure id=\"attachment_535\" aria-describedby=\"caption-attachment-535\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596_photo_1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-535\" title=\"st16c596_photo_1\" src=\"https:\/\/tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596_photo_1-300x199.jpg\" alt=\"ST16C596 shift register attached to an Arduino Diecimila\" width=\"300\" height=\"199\" srcset=\"https:\/\/www.tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596_photo_1-300x199.jpg 300w, https:\/\/www.tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596_photo_1.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><figcaption id=\"caption-attachment-535\" class=\"wp-caption-text\">STP16C596 shift register attached to an Arduino Diecimila<\/figcaption><\/figure><\/td>\n<td>\n<p><figure id=\"attachment_536\" aria-describedby=\"caption-attachment-536\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596_photo_2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-536\" title=\"st16c596_photo_2\" src=\"https:\/\/tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596_photo_2-300x199.jpg\" alt=\"The LED anodes go to 5V, the cathodes to the shift register's output pins\" width=\"300\" height=\"199\" srcset=\"https:\/\/www.tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596_photo_2-300x199.jpg 300w, https:\/\/www.tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596_photo_2.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-536\" class=\"wp-caption-text\">The LED anodes go to 5V, the cathodes to the shift register&#39;s output pins<\/figcaption><\/figure><\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p><figure id=\"attachment_537\" aria-describedby=\"caption-attachment-537\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-537\" title=\"st16c596\" src=\"https:\/\/tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596-300x151.png\" alt=\"The schematic\" width=\"300\" height=\"151\" srcset=\"https:\/\/www.tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596-300x151.png 300w, https:\/\/www.tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596-1024x516.png 1024w, https:\/\/www.tigoe.com\/pcomp\/code\/wp-content\/uploads\/2009\/05\/st16c596.png 1283w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-537\" class=\"wp-caption-text\">The schematic<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>The code<\/h2>\n<pre class=\"brush:arduino; light:true\">[include file=\"..\/..\/code\/Arduino\/multipleOutput\/ST16C596_0001\/ST16C596_0001.pde\" clean=\"true\"]<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will show how to control multiple LED outputs from a microcontroller using an STP16C596 shift register. The STP16C596 is similar to the popular 74HC595 shift register, but it&#8217;s nicer because it can sink a constant current to the LEDs it&#8217;s driving. It works slightly differently, however, so this code won&#8217;t work exactly for &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.tigoe.com\/pcomp\/code\/arduinowiring\/534\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;STP16C596 Shift Register&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,24],"tags":[63,66,61,65],"class_list":["post-534","post","type-post","status-publish","format-standard","hentry","category-arduinowiring","category-circuits","tag-led","tag-led-driver","tag-shift-register","tag-st16c596"],"_links":{"self":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":7,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"predecessor-version":[{"id":612,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/534\/revisions\/612"}],"wp:attachment":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}