{"id":368,"date":"2025-09-21T19:58:51","date_gmt":"2025-09-21T19:58:51","guid":{"rendered":"https:\/\/www.maddox.pro\/?p=368"},"modified":"2025-09-21T19:58:51","modified_gmt":"2025-09-21T19:58:51","slug":"a-win-sort-of-but-ill-take-it","status":"publish","type":"post","link":"https:\/\/www.maddox.pro\/?p=368","title":{"rendered":"A win, sort of, but I&#8217;ll take it"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Well the PCBs arrived and I decided to build up the CPU one slowly, not building the full thing. I&#8217;m glad I didn&#8217;t.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Eventually after a lot of messing around with CPLD and ROM code I got something booting, it&#8217;s the <a href=\"http:\/\/searle.x10host.com\/6502\/Simple6502.html\">Grant Searle ROM<\/a>, but it worked. The sticking point seems to be serial comms.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After much digging I discovered that the data on the data bus isn&#8217;t valid until 25nS after the clock edge, not a problem for older chips, but for the FT245 I&#8217;m using for the serial port it&#8217;s a problem. So after delaying the clock for the write a little I got some progress.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"734\" src=\"https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100-1024x734.jpg\" alt=\"PC6502 CPU board ,partially assembled and bodge wired.\" class=\"wp-image-369\" srcset=\"https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100-1024x734.jpg 1024w, https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100-300x215.jpg 300w, https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100-768x550.jpg 768w, https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100-1536x1101.jpg 1536w, https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100-1140x817.jpg 1140w, https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100.jpg 1765w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So there are a few bodge wires (underside) and a cut track or two. But, it does seem to work with a 4MHz crystal and the CPU running at half that, 2MHz. So it works, but for a 14MHz CPU, it&#8217;s not great.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a basic Mandlebrot output (0 to F or blank).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"957\" src=\"https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100_mandle.png\" alt=\"ASCII mandlebrot\" class=\"wp-image-370\" srcset=\"https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100_mandle.png 790w, https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100_mandle-248x300.png 248w, https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502_v100_mandle-768x930.png 768w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">However, it isn&#8217;t always consistent or stable. So I&#8217;ve made a new version of the PCB, this time I&#8217;ve brought the FTDI control pins direct to the CPLD, and I&#8217;ve done away with the discrete clock stretcher, again bringing the pins to the CPLD. This means I should be able to more precisely control the timing, and critically be able to make changes\/tweaks to improve it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is an example of the corruption on the serial terminal, it seems to only be on the serial terminal, but as I can&#8217;t run it fast yet I don&#8217;t know if there are other timing issues yet.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"957\" src=\"https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502V100_MandleCorrupt.png\" alt=\"Data corruption, good run at the top, corruption at the bottom.\" class=\"wp-image-371\" srcset=\"https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502V100_MandleCorrupt.png 790w, https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502V100_MandleCorrupt-248x300.png 248w, https:\/\/www.maddox.pro\/wp-content\/uploads\/2025\/09\/PC6502V100_MandleCorrupt-768x930.png 768w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can see the &#8221; and $ where there should be a space.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hopefully the next version will resolve this. You can find the files in <a href=\"https:\/\/github.com\/TechPaula\/PC6502\" data-type=\"link\" data-id=\"https:\/\/github.com\/TechPaula\/PC6502\">my GitHub<\/a>, but I take no responsibility for you losing your sanity trying to make this work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well the PCBs arrived and I decided to build up the CPU one slowly, not building the full thing. I&#8217;m glad I didn&#8217;t. Eventually after a lot of messing around with CPLD and ROM code I got something booting, it&#8217;s the Grant Searle ROM, but it worked. The sticking point seems to be serial comms. After much digging I discovered that the data on the data bus isn&#8217;t valid until 25nS after the clock edge, not a problem for older chips, but for the FT245 I&#8217;m using for the serial port it&#8217;s a problem. So after delaying the clock for the write a little I got some progress. So there are a few bodge wires (underside) and a cut track or two. But, it does seem to work with a 4MHz crystal and the CPU running at half that, 2MHz. So it works, but for a 14MHz CPU, it&#8217;s not great. Here is a basic Mandlebrot output (0 to F or blank). However, it isn&#8217;t always consistent or stable. So I&#8217;ve made a new version of the PCB, this time I&#8217;ve brought the FTDI control pins direct to the CPLD, and I&#8217;ve done away with the discrete clock stretcher, again bringing the pins to the CPLD. This means I should be able to more precisely control the timing, and critically be able to make changes\/tweaks to improve it. Here is an example of the corruption on the serial terminal, it seems to only be on the serial terminal, but as I can&#8217;t run it fast yet I don&#8217;t know if there are other timing issues yet. You can see the &#8221; and $ where there should be a space. Hopefully the next version will resolve this. You can find the files in my GitHub, but I take no responsibility for you losing your sanity trying to make this work.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[40],"tags":[],"class_list":["post-368","post","type-post","status-publish","format-standard","hentry","category-retro-computing"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.maddox.pro\/index.php?rest_route=\/wp\/v2\/posts\/368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.maddox.pro\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.maddox.pro\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.maddox.pro\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.maddox.pro\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=368"}],"version-history":[{"count":1,"href":"https:\/\/www.maddox.pro\/index.php?rest_route=\/wp\/v2\/posts\/368\/revisions"}],"predecessor-version":[{"id":372,"href":"https:\/\/www.maddox.pro\/index.php?rest_route=\/wp\/v2\/posts\/368\/revisions\/372"}],"wp:attachment":[{"href":"https:\/\/www.maddox.pro\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.maddox.pro\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.maddox.pro\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}