{"id":558,"date":"2024-05-11T19:59:08","date_gmt":"2024-05-11T18:59:08","guid":{"rendered":"http:\/\/robert.vanyi.org\/en\/?p=558"},"modified":"2024-05-11T20:11:53","modified_gmt":"2024-05-11T19:11:53","slug":"building-the-be6502-computer-the-microprocessor","status":"publish","type":"post","link":"https:\/\/robert.vanyi.org\/en\/archives\/558","title":{"rendered":"Building the BE6502 computer &#8211; the microprocessor"},"content":{"rendered":"\n<p>As the very first step to build up the actual Ben Eater 6502 breadboard computer is to connect and power the 6502 microprocessor. Just like Ben Eater, we also got the modern variant of the 6502, the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.westerndesigncenter.com\/wdc\/w65c02s-chip.php\" target=\"_blank\">65C02S<\/a> from Western Design Center (WDC). This time it was my son who came to my help: he took a new breadboard, and following the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.youtube.com\/watch?v=LnzuMJLZRdU\" target=\"_blank\">video<\/a> he attached the microprocessor and connected all the pins that needed to be connected, including +5V (VDD), GND (VSS) and the clock (PHI2). This is not a complicated setup, but of course one cannot really see what the processor is doing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/Processor_board.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/Processor_board.jpg\" alt=\"\" class=\"wp-image-561\" srcset=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/Processor_board.jpg 800w, https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/Processor_board-300x225.jpg 300w, https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/Processor_board-768x576.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption class=\"wp-element-caption\">Connected 65C02S<\/figcaption><\/figure>\n\n\n\n<p>To see what&#8217;s going on, I took the Arduino and connected all the address pins (A0-A15) and data pins (D0-D7) of the 65C02S to the extra digital IO ports of the Arduino.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/arduino-connected.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/arduino-connected.jpg\" alt=\"\" class=\"wp-image-562\" srcset=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/arduino-connected.jpg 800w, https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/arduino-connected-300x225.jpg 300w, https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/arduino-connected-768x576.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption class=\"wp-element-caption\">Checking address and data lines with Arduino<\/figcaption><\/figure>\n\n\n\n<p>With a small piece of SW as show in the video I could quickly see what was happening on the address and data buses. I mean almost&#8230; somehow the result didn&#8217;t match the one that Ben Eater got, but I quickly realized the root cause: he connected A15 through A0 to the even Ardunio ports 22-52, while I connected A0 thought A15. That is in the opposite order. But a quick change in the code fixed it. The final step was to add some resistors to connect the data pins and to hardcode the value 0xAE, so the output on the serial line was then just as expected:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"615\" height=\"208\" src=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/image.png\" alt=\"\" class=\"wp-image-559\" srcset=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/image.png 615w, https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/image-300x101.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/a><figcaption class=\"wp-element-caption\">Serial output of the address and data line monitoring<\/figcaption><\/figure>\n\n\n\n<p>To hardcode the value, you take the binary value 10101110, and connect D7 through D0 with 1k resistors to +5V (1) or to GND (0). You can really read it off from the legs of the resistors as you can see the picture below. My daughter liked it so much that together we calculated how to change the configuration so that it shows 0x2A, because she is in class 2A \ud83d\ude42 <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/hardcoding_resistors.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/hardcoding_resistors.jpg\" alt=\"\" class=\"wp-image-563\" srcset=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/hardcoding_resistors.jpg 800w, https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/hardcoding_resistors-300x225.jpg 300w, https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/hardcoding_resistors-768x576.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption class=\"wp-element-caption\">Resistors to hardcode data 0xAE, binary 11101010<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>As the very first step to build up the actual Ben Eater 6502 breadboard computer is to connect and power the 6502 microprocessor. Just like Ben Eater, we also got the modern variant of the 6502, the 65C02S from Western Design Center (WDC). This time it was my son who came to my help: he &hellip; <a href=\"https:\/\/robert.vanyi.org\/en\/archives\/558\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Building the BE6502 computer &#8211; the microprocessor<\/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":[76],"tags":[73,74,72],"class_list":["post-558","post","type-post","status-publish","format-standard","hentry","category-electronics","tag-73","tag-breadboard","tag-electronics"],"_links":{"self":[{"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/posts\/558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/comments?post=558"}],"version-history":[{"count":0,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/posts\/558\/revisions"}],"wp:attachment":[{"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/media?parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/categories?post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/tags?post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}