{"id":3113,"date":"2025-10-07T12:57:04","date_gmt":"2025-10-07T11:57:04","guid":{"rendered":"https:\/\/www.robertprice.co.uk\/robblog\/?p=3113"},"modified":"2025-10-07T17:44:13","modified_gmt":"2025-10-07T16:44:13","slug":"rc2025-part-1-how-does-the-nes-controller-send-data","status":"publish","type":"post","link":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/","title":{"rendered":"RC2025 &#8211; Part 1 &#8211; How does the NES controller send data?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">For this year&#8217;s RetroChallenge, I am hoping to interface an <a href=\"https:\/\/s.click.aliexpress.com\/e\/_c313mJNl\">NES \/ Famicon controller<\/a> to my RC2014 computer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The NES controller has 8 buttons: Up, Down, Left, Right, Select, Start, A, and B.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The cable only has 7 pins, so how can it send up to 8 button presses using 7 wires?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Well, the NES controller only actually uses 5 of those wires. Two of those wires are GND and +5V. The other three are Latch, Clock, and Data.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"330\" height=\"361\" src=\"https:\/\/www.robertprice.co.uk\/robblog\/assets\/NES.drawio.svg\" alt=\"A diagram of the NES controller port showing pin outs.\" class=\"wp-image-3115\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Inside the controller, there is a <a href=\"https:\/\/www.ti.com\/lit\/ds\/symlink\/cd4021b-q1.pdf\">4021 shift register<\/a>. When the Latch is pulsed from high to low, the 4021 captures the state of the buttons in 8 bits. The first capture bit will then be placed on the Data line. When Clock is pulsed from high to low, the 4021 will then shift the internal data one place forward, and the next bit will be placed on the Data line. When the next Clock pulse arrives, the next bit is sent, and so on. This needs to happen 8 times until all 8 bits have been sent. A low bit on the Data line means the button has been pressed; otherwise, the bit will remain high.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The bits are sent in the following order.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Bit<\/strong><\/td><td><strong>Button<\/strong><\/td><\/tr><tr><td>0<\/td><td>A<\/td><\/tr><tr><td>1<\/td><td>B<\/td><\/tr><tr><td>2<\/td><td>Select<\/td><\/tr><tr><td>3<\/td><td>Start<\/td><\/tr><tr><td>4<\/td><td>Up<\/td><\/tr><tr><td>5<\/td><td>Down<\/td><\/tr><tr><td>6<\/td><td>Left<\/td><\/tr><tr><td>7<\/td><td>Right<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Using software bit-banging, I should be able to send the Latch and Clock signals, and reassemble the received 8 bits back into a single byte.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For this year&#8217;s RetroChallenge, I am hoping to interface an NES \/ Famicon controller to my RC2014 computer. The NES controller has 8 buttons: Up, Down, Left, Right, Select, Start, A, and B. The cable only has 7 pins, so how can it send up to 8 button presses using 7 wires? Well, the NES &hellip; <a href=\"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;RC2025 &#8211; Part 1 &#8211; How does the NES controller send data?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3107,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[181],"tags":[183,117,185,137],"class_list":["post-3113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rc2025","tag-nes-joypad","tag-rc2014","tag-rc2025","tag-retro-challenge"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>RC2025 - Part 1 - How does the NES controller send data? - Robert Price<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RC2025 - Part 1 - How does the NES controller send data? - Robert Price\" \/>\n<meta property=\"og:description\" content=\"For this year&#8217;s RetroChallenge, I am hoping to interface an NES \/ Famicon controller to my RC2014 computer. The NES controller has 8 buttons: Up, Down, Left, Right, Select, Start, A, and B. The cable only has 7 pins, so how can it send up to 8 button presses using 7 wires? Well, the NES &hellip; Continue reading &quot;RC2025 &#8211; Part 1 &#8211; How does the NES controller send data?&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/\" \/>\n<meta property=\"og:site_name\" content=\"Robert Price\" \/>\n<meta property=\"article:published_time\" content=\"2025-10-07T11:57:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-07T16:44:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.robertprice.co.uk\/robblog\/assets\/classic-nes-joypad.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"757\" \/>\n\t<meta property=\"og:image:height\" content=\"570\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"rob\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rob\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/\"},\"author\":{\"name\":\"rob\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#\\\/schema\\\/person\\\/fac6d5b076e0e14e1fb13e15b542a6c5\"},\"headline\":\"RC2025 &#8211; Part 1 &#8211; How does the NES controller send data?\",\"datePublished\":\"2025-10-07T11:57:04+00:00\",\"dateModified\":\"2025-10-07T16:44:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/\"},\"wordCount\":238,\"image\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/assets\\\/classic-nes-joypad.jpg\",\"keywords\":[\"NES Joypad\",\"RC2014\",\"RC2025\",\"Retro Challenge\"],\"articleSection\":[\"RC2025\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/\",\"url\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/\",\"name\":\"RC2025 - Part 1 - How does the NES controller send data? - Robert Price\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/assets\\\/classic-nes-joypad.jpg\",\"datePublished\":\"2025-10-07T11:57:04+00:00\",\"dateModified\":\"2025-10-07T16:44:13+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#\\\/schema\\\/person\\\/fac6d5b076e0e14e1fb13e15b542a6c5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/assets\\\/classic-nes-joypad.jpg\",\"contentUrl\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/assets\\\/classic-nes-joypad.jpg\",\"width\":757,\"height\":570,\"caption\":\"NES Joypad\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2025-part-1-how-does-the-nes-controller-send-data\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RC2025 &#8211; Part 1 &#8211; How does the NES controller send data?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#website\",\"url\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/\",\"name\":\"Robert Price\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#\\\/schema\\\/person\\\/fac6d5b076e0e14e1fb13e15b542a6c5\",\"name\":\"rob\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"caption\":\"rob\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RC2025 - Part 1 - How does the NES controller send data? - Robert Price","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/","og_locale":"en_GB","og_type":"article","og_title":"RC2025 - Part 1 - How does the NES controller send data? - Robert Price","og_description":"For this year&#8217;s RetroChallenge, I am hoping to interface an NES \/ Famicon controller to my RC2014 computer. The NES controller has 8 buttons: Up, Down, Left, Right, Select, Start, A, and B. The cable only has 7 pins, so how can it send up to 8 button presses using 7 wires? Well, the NES &hellip; Continue reading \"RC2025 &#8211; Part 1 &#8211; How does the NES controller send data?\"","og_url":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/","og_site_name":"Robert Price","article_published_time":"2025-10-07T11:57:04+00:00","article_modified_time":"2025-10-07T16:44:13+00:00","og_image":[{"width":757,"height":570,"url":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/classic-nes-joypad.jpg","type":"image\/jpeg"}],"author":"rob","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rob","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/#article","isPartOf":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/"},"author":{"name":"rob","@id":"https:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5"},"headline":"RC2025 &#8211; Part 1 &#8211; How does the NES controller send data?","datePublished":"2025-10-07T11:57:04+00:00","dateModified":"2025-10-07T16:44:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/"},"wordCount":238,"image":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/#primaryimage"},"thumbnailUrl":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/classic-nes-joypad.jpg","keywords":["NES Joypad","RC2014","RC2025","Retro Challenge"],"articleSection":["RC2025"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/","url":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/","name":"RC2025 - Part 1 - How does the NES controller send data? - Robert Price","isPartOf":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/#primaryimage"},"image":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/#primaryimage"},"thumbnailUrl":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/classic-nes-joypad.jpg","datePublished":"2025-10-07T11:57:04+00:00","dateModified":"2025-10-07T16:44:13+00:00","author":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5"},"breadcrumb":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/#primaryimage","url":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/classic-nes-joypad.jpg","contentUrl":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/classic-nes-joypad.jpg","width":757,"height":570,"caption":"NES Joypad"},{"@type":"BreadcrumbList","@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2025-part-1-how-does-the-nes-controller-send-data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.robertprice.co.uk\/robblog\/"},{"@type":"ListItem","position":2,"name":"RC2025 &#8211; Part 1 &#8211; How does the NES controller send data?"}]},{"@type":"WebSite","@id":"https:\/\/www.robertprice.co.uk\/robblog\/#website","url":"https:\/\/www.robertprice.co.uk\/robblog\/","name":"Robert Price","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.robertprice.co.uk\/robblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5","name":"rob","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","caption":"rob"}}]}},"_links":{"self":[{"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/3113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/comments?post=3113"}],"version-history":[{"count":7,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/3113\/revisions"}],"predecessor-version":[{"id":3133,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/3113\/revisions\/3133"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/media\/3107"}],"wp:attachment":[{"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/media?parent=3113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/categories?post=3113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/tags?post=3113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}