{"id":346,"date":"2016-05-15T17:00:55","date_gmt":"2016-05-16T00:00:55","guid":{"rendered":"http:\/\/tubetime.us\/?p=346"},"modified":"2024-07-05T14:52:10","modified_gmt":"2024-07-05T14:52:10","slug":"placeholder","status":"publish","type":"post","link":"https:\/\/tubetime.us\/index.php\/2016\/05\/15\/placeholder\/","title":{"rendered":"The MOnSter 6502"},"content":{"rendered":"<p>So, I made a thing. A really big thing. Really big and really crazy.<\/p>\n<p><a href=\"http:\/\/tubetime.us\/wp-content\/uploads\/2016\/05\/DSC_6759_scaled.jpg\"><img loading=\"lazy\" class=\"alignnone wp-image-564 size-full\" src=\"http:\/\/tubetime.us\/wp-content\/uploads\/2016\/05\/DSC_6759_scaled.jpg\" alt=\"\" width=\"2000\" height=\"1325\" \/><\/a><\/p>\n<p>You might have seen my discrete <a href=\"http:\/\/shop.evilmadscientist.com\/productsmenu\/652\" target=\"_blank\" rel=\"noopener\">555<\/a> and <a href=\"http:\/\/shop.evilmadscientist.com\/productsmenu\/762\" target=\"_blank\" rel=\"noopener\">741<\/a> IC electronics kits. Well, a while back I had this idea about creating a discrete version of a microprocessor, but it just sounded too difficult, time consuming, or impractical. And part of me didn\u2019t want to do it, because it just sounds so tedious to design&#8211;at every stage, I was secretly hoping to find a show-stopping problem. But part of me was really interested to see if it could be done.<\/p>\n<p>At dinner, Windell and I went through a thought experiment to see if it would even be possible. We weren\u2019t sure how many transistors were in a 6502 (more than 1,000 but less than 10,000). If four surface mount transistors can fit in a square centimeter, then the board would need to be about 1,000 square centimeters, or about 32cm (13in) on a side, which is not as huge as we originally thought. Darn it, time to investigate further!<\/p>\n<p>The hard work of reverse engineering the actual 6502 has already been done by the folks at <a href=\"http:\/\/visual6502.org\" target=\"_blank\" rel=\"noopener\">Visual6502.org<\/a>. I was able to extract the netlist from their <a href=\"http:\/\/visual6502.org\/JSSim\/index.html\" target=\"_blank\" rel=\"noopener\">Javascript simulation<\/a>, which contains a list of all the transistors and every single wire connecting them together.<\/p>\n<p>The 6502 uses dynamic NMOS logic, so it has a large number of \u201c<a href=\"https:\/\/en.wikipedia.org\/wiki\/Transmission_gate\" target=\"_blank\" rel=\"noopener\">transmission gate<\/a>\u201d transistors that are used to switch currents. For various technical reasons, only a 4-terminal MOSFET can make an effective NMOS transmission gate. Those are really hard to find (nearly all MOSFETs are 3-terminal devices), but I found one&#8211;it\u2019s an array of 4 MOSFETs on a single chip with a separate substrate pin.<\/p>\n<p>I ran simulations using the transistors I found, and noticed that basic combinational logic and latches worked. I ordered parts and prototyped a few circuits. They worked perfectly.<\/p>\n<p>I designed and ordered an <a href=\"http:\/\/oshpark.com\" target=\"_blank\" rel=\"noopener\">OSH Park<\/a> circuit board with just 8 bits of the program counter register. I thought to myself that there was no way such a complex circuit could work, especially with the ripple carry propagation. Well, it worked.<\/p>\n<p><a href=\"http:\/\/tubetime.us\/wp-content\/uploads\/2016\/05\/DSC_6768_scaled.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-565\" src=\"http:\/\/tubetime.us\/wp-content\/uploads\/2016\/05\/DSC_6768_scaled.jpg\" alt=\"\" width=\"1000\" height=\"522\" \/><\/a><\/p>\n<p>It was time to bite the bullet. I wrote a Python program that turned the Visual6502 netlist into a 3,510 line spreadsheet, and I began entering (on <a href=\"https:\/\/twitter.com\/TubeTimeUS\/status\/617108015091548160\" target=\"_blank\" rel=\"noopener\">July 3, 2015<\/a>) the transistors one by one into the schematic, highlighting each transistor as I finished it. Along the way, I noticed that the Visual6502 netlist had three extra transistors, T1088, T1023, and T3037.<br \/>\n<a href=\"http:\/\/tubetime.us\/wp-content\/uploads\/2016\/05\/extrav6502trans.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-566\" src=\"http:\/\/tubetime.us\/wp-content\/uploads\/2016\/05\/extrav6502trans.png\" alt=\"\" width=\"197\" height=\"222\" \/><\/a><br \/>\n(An example of an extra transistor)<\/p>\n<p>When I was done with all 61 pages, I wrote another Python program to compare my schematic against the original netlist and corrected a few mistakes. Then I added 167 colorful LEDs to various control lines and data bits, and a few protection components.<\/p>\n<p>The layout came next. In the layout software, I placed 4,304 parts by hand and wired them up manually (no autorouter) over the course of several months, finishing the last transistor on <a href=\"https:\/\/twitter.com\/TubeTimeUS\/status\/671934447168557056\" target=\"_blank\" rel=\"noopener\">Dec 1, 2015<\/a>.<\/p>\n<p>And last Thursday, the first boards came in. They are beautiful!<\/p>\n<p><a href=\"http:\/\/tubetime.us\/wp-content\/uploads\/2016\/05\/DSC_6738_scaled.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-567\" src=\"http:\/\/tubetime.us\/wp-content\/uploads\/2016\/05\/DSC_6738_scaled.jpg\" alt=\"\" width=\"1000\" height=\"664\" \/><\/a><\/p>\n<p>We\u2019ll be bringing it to Maker Faire, so I have a week to work on bringup testing. Wish me luck!<\/p>\n<p>You can find more details on the main project site, <a href=\"http:\/\/monster6502.com\/\" target=\"_blank\" rel=\"noopener\">monster6502.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I made a thing. A really big thing. Really big and really crazy. You might have seen my discrete 555 and 741 IC electronics kits. Well, a while back I had this idea about creating a discrete version of a microprocessor, but it just sounded too difficult, time consuming, or impractical. And part of [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p80Z1r-5A","_links":{"self":[{"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/posts\/346"}],"collection":[{"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/comments?post=346"}],"version-history":[{"count":2,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/posts\/346\/revisions"}],"predecessor-version":[{"id":568,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/posts\/346\/revisions\/568"}],"wp:attachment":[{"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/media?parent=346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/categories?post=346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/tags?post=346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}