<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>FromOrbit.com</title>
    <description>Generic nerd who dabbles in programming, electronics, CNC and retro computing.
</description>
    <link>https://fromorbit.com/</link>
    <atom:link href="https://fromorbit.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 25 Apr 2025 12:35:06 +1000</pubDate>
    <lastBuildDate>Fri, 25 Apr 2025 12:35:06 +1000</lastBuildDate>
    <generator>Jekyll v4.2.2</generator>
    
      <item>
        <title>Alan&apos;s Wishlist</title>
        <description>&lt;h1 id=&quot;wish-list&quot;&gt;Wish List&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://sydneytools.com.au/product/chicago-air-hush70h-silenced-70l-air-compressor&quot;&gt;Chicago Air HUSH70-H Silenced 70L Air Compressor&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://gasrep.com.au/shop/welders/tig-welders/ac-dc-tig-welders/duralloy-da201mweld-multiweld-201-pfc-4in1-mig-welder/&quot;&gt;Duralloy Multiweld 201 PFC 4in1 MIG Welder&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Fri, 25 Apr 2025 00:00:00 +1000</pubDate>
        <link>https://fromorbit.com/2025/04/25/Alan-wishlist-or-stuff-he-wants-to-remember.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2025/04/25/Alan-wishlist-or-stuff-he-wants-to-remember.html</guid>
        
        
      </item>
    
      <item>
        <title>45W IRF510 HF Linear Amp</title>
        <description>&lt;h1 id=&quot;45w-irf510-hf-linear-amp&quot;&gt;45W IRF510 HF Linear Amp&lt;/h1&gt;

&lt;p&gt;Boy it’s been a long time between posts. Sorry about that. I got real lazy and
just starting pumping my content into twitter and really just never took the
time to document things.&lt;/p&gt;

&lt;p&gt;Anyway, here is a project I built to get me out of QRP land and being heard my
frequently on the 20M and 40M bands.&lt;/p&gt;

&lt;h2 id=&quot;cq-cq-cq&quot;&gt;“CQ CQ CQ”&lt;/h2&gt;

&lt;p&gt;Finally getting around to sitting for my HAM license I started off with my
first HF radio, the very useful uBitX v6. It’s a great radio to start with for
a tinker like me. It’s open sourced schematic and firmware allows fiddling and
updating and there is always a wealth of ideas and projects on the internet for
it.&lt;/p&gt;

&lt;p&gt;With it’s mighty 5W output and using my home-brew EFHW antenna I would make
countless “CQ” calls hoping someone would hear me. I went on for weeks if not
months tweaking this, and tuning that but nobody seemed to ever hear me. So I
set about creating my first linear amplifier. Inspired by a design in
“Experimental Methods in RF Design” EMRFD I set about building myself a linear
amplifier to get above the noise.&lt;/p&gt;

&lt;h2 id=&quot;oh-the-things-you-learn&quot;&gt;“Oh the things you learn”&lt;/h2&gt;

&lt;p&gt;So, I at first figured I’d bash together a prototype on some copper clad and
see how it would go…&lt;/p&gt;

&lt;figure class=&quot;third &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear2.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear2.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear2.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear2.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear2.jpg 1280w&quot; alt=&quot;picture two&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear3.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear3.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear3.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear3.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear3.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear4.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear4.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear4.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear4.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear4.jpg 1280w&quot; alt=&quot;picture one&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;I got some output! 4dBm (2.5mW) input netted me 31dBm (1.2W) output from 12V!&lt;/p&gt;

&lt;p&gt;Suffice to say I was stoked…. then it started oscillating.&lt;/p&gt;

&lt;p&gt;Speaking with my Elmer he suggested my crappy hacked together layout wasn’t
conducive to a high power amplifier with fairly high gain, and that perhaps I
should do a cleaner layout. So I cracked out my CNC mill and Kicad and made a
prototype.&lt;/p&gt;

&lt;h2 id=&quot;there-aint-no-thang-like-a-cnc&quot;&gt;“There ain’t no thang like a CNC”&lt;/h2&gt;

&lt;figure class=&quot;half &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear5.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear5.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear5.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear5.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear5.jpg 1280w&quot; alt=&quot;picture two&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear6.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear6.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear6.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear6.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear6.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;Layout done, board turned out nice. Time to build it.&lt;/p&gt;

&lt;figure class=&quot; &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear7.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear7.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear7.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear7.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear7.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;Using a large chunk of heat-sink I cut down from an old stage lighting dimmer,
I mounted the MOSFETs with insulators onto the heat-sink. The PCB was then
mounted on top and the board mounted on stand-offs.&lt;/p&gt;

&lt;figure class=&quot;third &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear8.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear8.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear8.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear8.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear8.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear10.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear10.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear10.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear10.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear10.jpg 1280w&quot; alt=&quot;picture one&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear11.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear11.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear11.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear11.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear11.jpg 1280w&quot; alt=&quot;picture two&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;It was about this time I realised I screwed up the schematic and had the gate
and drain on one MOSFET arse about. Dutifully I hacked in a modification and
continued.&lt;/p&gt;

&lt;p&gt;All the components and coils were wound, and the moment of truth&lt;/p&gt;

&lt;h2 id=&quot;power-up-time&quot;&gt;Power up time!&lt;/h2&gt;

&lt;figure class=&quot;half &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear13.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear13.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear13.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear13.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear13.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear12.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear12.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear12.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear12.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear12.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;Powered it up, connected it to my uBitX and whistled into the mic and received
46dBm (39.8W) of output from 24dBm (250mW) of input! I was very very pleased.
No oscillations, nice clear output and all looked very good and pleasing.&lt;/p&gt;

&lt;h2 id=&quot;now-lets-make-a-proper-version-this-time&quot;&gt;Now let’s make a proper version this time&lt;/h2&gt;

&lt;figure class=&quot;half &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear14.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear14.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear14.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear14.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear14.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear15.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear15.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear15.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear15.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear15.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;A new layout was made, a new board was milled on the CNC and the components
transferred across to the new board&lt;/p&gt;

&lt;figure class=&quot; &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear16.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear16.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear16.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear16.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear16.jpg 1280w&quot; alt=&quot;picture one&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;Worked perfectly. Pushing the input power up to 30V @ 3A the amp will easily
get to 50W into 50 ohms, but I limit the supply to 28V and that seems to keep
it around 45W output.&lt;/p&gt;

&lt;h2 id=&quot;time-for-an-txrx-switcher&quot;&gt;Time for an TX/RX switcher&lt;/h2&gt;

&lt;figure class=&quot;third &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear17.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear17.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear17.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear17.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear17.jpg 1280w&quot; alt=&quot;picture two&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear18.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear18.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear18.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear18.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear18.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear19.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear19.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear19.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear19.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear19.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;I needed a way to interface the linear with the uBitX. I pulled 12V from the
TX/RX relay inside the uBitX and brought it outside to control a relay block I
made for the linear. I really should just create a TX sensor on the input of
the linear and have it handle the switching itself (future project) but for now
this works.&lt;/p&gt;

&lt;h2 id=&quot;put-it-in-a-box&quot;&gt;Put it in a box!&lt;/h2&gt;

&lt;figure class=&quot;third &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear20.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear20.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear20.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear20.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear20.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear21.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear21.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear21.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear21.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear21.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear23.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear23.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear23.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear23.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear23.jpg 1280w&quot; alt=&quot;picture two&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear24.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear24.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear24.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear24.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear24.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear25.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear25.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear25.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear25.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear25.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear26.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear26.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear26.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear26.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear26.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;An old ATX PSU steel case was used to house the amplifier. It was handy because
it had a 80mm fan already in the box and it was steel, so provided good
shielding. Not much to look at though.&lt;/p&gt;

&lt;h2 id=&quot;so-hows-it-going&quot;&gt;So, how’s it going?&lt;/h2&gt;

&lt;p&gt;After using it on air for a while and having finally breaking through the noise
I have had many successful QSOs from all over Australia, NZ and the USA.&lt;/p&gt;

&lt;figure class=&quot; &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2022-05-23/linear27.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2022-05-23/linear27.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2022-05-23/320-linear27.jpg 320w,https://fromorbit.com/assets/images/2022-05-23/640-linear27.jpg 640w,https://fromorbit.com/assets/images/2022-05-23/1280-linear27.jpg 1280w&quot; alt=&quot;picture three&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;Suffice to say I’m really very very happy with it.&lt;/p&gt;
</description>
        <pubDate>Mon, 23 May 2022 00:00:00 +1000</pubDate>
        <link>https://fromorbit.com/2022/05/23/IRF510-linear-amp.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2022/05/23/IRF510-linear-amp.html</guid>
        
        
      </item>
    
      <item>
        <title>More fun with the m68k</title>
        <description>&lt;h1 id=&quot;the-last-days-of-the-retro-challenge&quot;&gt;The last days of the Retro Challenge&lt;/h1&gt;

&lt;p&gt;The Retro Challenge behind me, and not actually achieving my goal I was pretty
disappointed that work/life commitments stacked against me in getting there.
That didn’t stop me from completing my goal, just wasn’t in the time frame of
the competition.&lt;/p&gt;

&lt;p&gt;Where I left off lasted I had my bootloader working and a basic assembler
environment working, but I wanted a high level language to create my Mandelbrot
set. I didn’t want to write it in assembler.&lt;/p&gt;

&lt;h1 id=&quot;the-first-steps&quot;&gt;The first steps&lt;/h1&gt;

&lt;p&gt;I got the idea that since I had a linker script, etc setup it wouldn’t be a
long stretch to get GCC and libc working. So I set out to do just that.&lt;/p&gt;

&lt;p&gt;After a few nights fiddling around and hitting a bug in the version of GCC and
libc where the compiler would crash because I was missing a linker directive,
but even when fixed the compiler would still bomb. After much research it
seemed to be a bug that I really wasn’t in the mood to research and fix, or to
update the environment. Also the output I got was really large and inefficient,
so I started looking for an alternative.&lt;/p&gt;

&lt;h1 id=&quot;enter-crosstool-ng&quot;&gt;Enter crosstool-ng&lt;/h1&gt;

&lt;p&gt;Not looking forward to the prospect of compiling GCC and all the rest manually
I started looking for tool-chains I could get that wouldn’t require a lot of
fiddly setup, another thing is that a lot of m68k is getting long in the tooth
and the tool-chains and tools are deteriorating at an alarming rate. After a few
nights looking around I stumbled upon
(crosstool-ng)[http://crosstool-ng.github.io/].&lt;/p&gt;

&lt;p&gt;An unassuming utility that builds tool-chains for various processors and setups,
one of which is m68k based systems. During my search for a new tool-chain I also
stumbled upon Newlib, a libc alternative that is much lighter than standard
libc and has abstracted I/O functions out to basically eight system calls.&lt;/p&gt;

&lt;p&gt;After about 20 minutes with crosstool-ng I had a new Newlib based tool-chain
ready. Here are the basic steps I took to build the tool-chain:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Get the latest crosstool-ng&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git clone https://github.com/crosstool-ng/crosstool-ng
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;crosstool-ng
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./bootstrap

&lt;span class=&quot;c&quot;&gt;# Build the crosstool-ng&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./configure &lt;span class=&quot;nt&quot;&gt;--prefix&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/opt/crosstool-ng
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:/opt/crosstool-ng/bin&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Make a working dir&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mkdir &lt;/span&gt;work-dir
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;work-dir

&lt;span class=&quot;c&quot;&gt;# I used the m68k-unknown-elf &quot;sample&quot; as it had all I needed&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ct-ng m68k-unknown-elf
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ct-ng menuconfig
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ct-ng build
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After a little while you’ll end up with a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x-tools&lt;/code&gt; directory with all the
tools you need!&lt;/p&gt;

&lt;h1 id=&quot;time-to-test-the-compiler&quot;&gt;Time to test the compiler&lt;/h1&gt;

&lt;p&gt;I made a simple project that simply setup the UART and output “Hello world”,
the linker was setup to operate purely from RAM so the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.data&lt;/code&gt; didn’t need to
be copied and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bss&lt;/code&gt; was already cleared. I needed to implement the basic
functions that Newlib mandates :&lt;/p&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;fstat&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getpid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;isatty&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;kill&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;off_t&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;lseek&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;off_t&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;whence&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;putnum&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;sbrk&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nbytes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;stat&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;unlink&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;write&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nbytes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You don’t need to implement all these functions, initially I just implemented
each one I needed as the compiler complained. I found for a simple UART output
I only needed four.&lt;/p&gt;

&lt;p&gt;It compiled just fine and when I copy and pasted the srec data into my bootload
I was happily presented with a “Hello world!”&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;en&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;F%^&amp;amp; YEAH! gcc and Newlib work! This is a `printf()` compiled with GCC output as srecord data and pasted into my bootloader. WORKED! YAY! &lt;a href=&quot;https://t.co/PpjcL73qq1&quot;&gt;pic.twitter.com/PpjcL73qq1&lt;/a&gt;&lt;/p&gt;&amp;mdash; Alan Garfield (@alangarf) &lt;a href=&quot;https://twitter.com/alangarf/status/861920638922924032&quot;&gt;May 9, 2017&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;p&gt;Suffice to say I was pretty damn happy&lt;/p&gt;

&lt;h1 id=&quot;mandelbrot-now&quot;&gt;Mandelbrot now?&lt;/h1&gt;

&lt;p&gt;Even though I now was ready to build a Mandelbrot set I was still unhappy with the
fact my init code and the required Newlib system calls weren’t implemented that
well. Plus I had a bug I noticed where the CPU would crash if I called too many
subroutines. This last one was pretty easy to fix but it did require me to
clean up my linker script and create something more complete. The issue with
the crash was my heap space and stack space was colliding. I was artificially
reducing the heap space to make the upload to the board smaller. I was having
race conditions in the silly terminal I was using that was causing my
bootloader to miss characters etc.&lt;/p&gt;

&lt;p&gt;So, rather than make a Mandelbrot I set about to build a “BSP” (Board Support
Package) for this board.&lt;/p&gt;

&lt;h1 id=&quot;an-amx-axc-em-bsp&quot;&gt;An AMX AXC-EM BSP&lt;/h1&gt;

&lt;p&gt;To start with this seemed like it would be much harder until I found the source
for Newlib itself, and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libgloss&lt;/code&gt; library. Inside the source for the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;m68k&lt;/code&gt;
in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libgloss&lt;/code&gt; it had implementations of BSPs for other m68k based boards.&lt;/p&gt;

&lt;p&gt;Using the details of a few of these boards I was able to piece together what
was required to make a BSP for this board. With a little bit of testing and
poking around I managed to make a support library that made compiling things
for this board almost trivial!&lt;/p&gt;

&lt;p&gt;I’ve pushed this BSP to github: (AMX AXC-EM BSP)[https://github.com/alangarf/axc-em-bsp]&lt;/p&gt;

&lt;p&gt;To use it all you need to do is point the linker of your project to  the
resulting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libamx.a&lt;/code&gt; and use the linker script for linking and you project
should just work.&lt;/p&gt;

&lt;p&gt;I’m slowly adding more details for the peripherals of the MC68340 as I go, but
so far it has what is needed for the UART.&lt;/p&gt;

&lt;h1 id=&quot;now-a-mandelbrot&quot;&gt;Now a Mandelbrot?&lt;/h1&gt;

&lt;p&gt;You bet. Being lazy I looked around on github.com for a C-based ASCII
Mandelbrot routine. The first one I found seemed simple, but turned out to be
extremely inefficient. I build and tested it on the board, but initially I
thought the board crashed. Just luckily I left it running and after a few
minutes a single line of a Mandelbrot had been output.&lt;/p&gt;

&lt;p&gt;Leaving it for another 20 minutes only another 5 lines where added. Thinking
that the CPU had slipped out of it’s 16MHz clock mode I reconfirmed that the
clock was at the right speed. It was just very inefficient code.&lt;/p&gt;

&lt;p&gt;Looking for another source of laziness I found
&lt;a href=&quot;https://github.com/vain/asciibrot/blob/master/asciibrot.c&quot;&gt;asciibrot&lt;/a&gt;. It was
designed to do animation etc, but really all I wanted was a single rendering of
a Mandelbrot. So I tore the routines apart and finally got myself this output:&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;en&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Yay I finally achieved my &lt;a href=&quot;https://twitter.com/retrochallenge&quot;&gt;@retrochallenge&lt;/a&gt; goal. I can render a mandelbrot set written in C on this m68k board! Better late than never. :D &lt;a href=&quot;https://t.co/wDoZAdDz2H&quot;&gt;pic.twitter.com/wDoZAdDz2H&lt;/a&gt;&lt;/p&gt;&amp;mdash; Alan Garfield (@alangarf) &lt;a href=&quot;https://twitter.com/alangarf/status/864813565282205696&quot;&gt;May 17, 2017&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;p&gt;Gosh I was so happy when I finally saw that. Over a month on and off mucking
around with this and finally achieved my goal, plus along the way I learned so
much more (and relearned a bunch of stuff I’d long forgotten). It was an awesome
challenge and also the biggest possible reward of entering the Retro Challenge
itself.&lt;/p&gt;

&lt;h1 id=&quot;any-more-examples&quot;&gt;Any more examples?&lt;/h1&gt;

&lt;p&gt;Here is a real-time display of the board rendering a larger Mandelbrot set.&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;
    
    
        &lt;img src=&quot;https://fromorbit.com/assets/images/2017-05-19/mandelbrot.gif&quot; alt=&quot;&quot; /&gt;
    
    

&lt;/figure&gt;

&lt;p&gt;An here is a better example showing the actual CPU speed by character. I
removed the line buffering so each character can be seen as it is rendered.&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;
    
    
        &lt;img src=&quot;https://fromorbit.com/assets/images/2017-05-19/mandelbrot-2.gif&quot; alt=&quot;&quot; /&gt;
    
    

&lt;/figure&gt;

&lt;p&gt;So now I have a really good tool-chain, a working linker script and can
basically compile anything I like. I think the next test is to get the on board
I/O devices sorted out (eg. the clock/calendar, the DIP switches and the I/O
pins I’ve found) and make it do something more fun. A clock? A vector display
controller with some ADCs? You’ll have to wait and see.&lt;/p&gt;

</description>
        <pubDate>Fri, 19 May 2017 00:00:00 +1000</pubDate>
        <link>https://fromorbit.com/2017/05/19/m68k-crosstool-ng.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2017/05/19/m68k-crosstool-ng.html</guid>
        
        
      </item>
    
      <item>
        <title>m68k Environment - Retro Challenge 2017/04</title>
        <description>&lt;p&gt;So, for this post I want to talk about my development environment and where I’m
up to as far as the Retro Challenge.&lt;/p&gt;

&lt;p&gt;I’ve had a &lt;em&gt;lot&lt;/em&gt; of issues with this project. Initially I was cruising well and
looking well on track to make something really cool, but then I damaged the
board.&lt;/p&gt;

&lt;p&gt;The board started to exhibit a fault with it’s ability to load bytes from ROM.
This became apparent as I started porting the TS2 ROM Monitor. When the fault
occurred I started to gradually break the application down to the point of just
the minimal initialization stuff for the CPU and UART and printing a string
from ROM to the UART.&lt;/p&gt;

&lt;p&gt;As I was doing this testing, the CPU would appear to
crash or not properly enter into any exception handler (even when forced too by
using an illegal instruction!). After many, many days of trial and error and
screaming at the board I finally broke it down to the point of it was either a
faulty CPU or I’m a complete idiot and can’t write five m68k assembly
instructions.&lt;/p&gt;

&lt;p&gt;So, I cut my losses and switch to my fall back board that was a little newer
and based on a MC68340 CPU. My main hesitation initially for not using this
board to begin with was that it was a peripheral integrated CPU, which meant
the board was basically ROM, RAM, CPU, and power related parts.&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-18/axc-em.jpg&quot; alt=&quot;AMX AXC-EM board.&quot; /&gt;&lt;figcaption&gt;
      The AMX AXC-EM board.

    &lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;As it stands I’ve had a much more enjoyable time working with this board and so
have progressed much further with the software, rather than staring at a
blinking LED and hoping it blinks &lt;em&gt;just right&lt;/em&gt; this time (if you follow me on
Twitter you’ll know what I mean)..&lt;/p&gt;

&lt;h1 id=&quot;the-software-environment&quot;&gt;The Software Environment.&lt;/h1&gt;

&lt;p&gt;At the moment I’m writing everything in assembler for the m68k. I’m on a
Macbook Pro and I run the m68k development environment in a Ubuntu Xenial VM
using Vagrant. Rather than trying to setup the cross compiler in OSX, I just
opted to use Linux and the Ubuntu m86k deb packages.&lt;/p&gt;

&lt;p&gt;So, to edit the code I use a Vagrant share and access the files in OSX using
Vim in iTerm, and in another panel I have an open SSH session into the VM to do
the compilation.&lt;/p&gt;

&lt;p&gt;To get the code onto the EEPROMs I use a &lt;a href=&quot;http://www.autoelectric.cn/en/tl866_main.html&quot;&gt;TL866a MiniPro
programmer&lt;/a&gt;, which I’ve compiled
the &lt;a href=&quot;https://github.com/vdudouyt/minipro&quot;&gt;open source command line tool&lt;/a&gt; for it
in OSX. This means to program the EEPROMs I run the commands in OSX.&lt;/p&gt;

&lt;p&gt;Sounds difficult but it’s really not. I have a Makefile which handles all the
compiling and ROM images, plus outputting dump files. It also has the recipe
for programming the even and odd ROM images to the EEPROMs via the MiniPro
tool.&lt;/p&gt;

&lt;p&gt;The flow sorta looks like this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Makes changes to the source code in vim inside one iTerm pane.&lt;/li&gt;
  &lt;li&gt;Switch to the VM pane that’s SSH’d into the VM. Run the make compile command.&lt;/li&gt;
  &lt;li&gt;Switch back to the editor pane in iTerm.&lt;/li&gt;
  &lt;li&gt;Put the even EEPROM in the programmer.&lt;/li&gt;
  &lt;li&gt;From inside vim run the make commands to program the even EEPROM&lt;/li&gt;
  &lt;li&gt;Rinse repeat for the odd ROM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the Makefile I’m using, you can see it &lt;a href=&quot;https://github.com/alangarf/amx_axc_m68k/blob/master/Makefile&quot;&gt;here on Github
too.&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;M68K=m68k-linux-gnu
AS=$(M68K)-as
LD=$(M68K)-ld
COPY=$(M68K)-objcopy
DUMP=$(M68K)-objdump

ASFLAGS=-m68340 --warn --fatal-warnings
LDFLAGS=-T m68k.ld
DUMPFLAGS=-m68020 -x -D

EEPROM=AT28C256
PREFIX=m68k-

FMT=binary

SRCS=loader.s
OBJS=$(SRCS:.s=.o)
MAIN=loader

.PHONY: dump clean

all:	$(MAIN)

.s.o:
	$(AS) $(ASFLAGS) -o $@ $&amp;lt;

$(MAIN): $(OBJS)
	$(LD) $(LDFLAGS) -o $(MAIN).a $(OBJS)
	$(COPY) -b 0 -i 2 --interleave-width=1 -O $(FMT) $(MAIN).a $(PREFIX)$(MAIN)-even.bin
	$(COPY) -b 1 -i 2 --interleave-width=1 -O $(FMT) $(MAIN).a $(PREFIX)$(MAIN)-odd.bin

clean:
	rm -f *.o $(PREFIX)$(MAIN)-even.bin $(PREFIX)$(MAIN)-odd.bin $(PREFIX)$(MAIN).bin $(MAIN).a

prog_even:
	@echo Programming $(MAIN)-even onto $(EEPROM)
	minipro -p &quot;$(EEPROM)&quot; -w $(PREFIX)$(MAIN)-even.bin -s

prog_odd:
	@echo Programming $(MAIN)-odd onto $(EEPROM)
	minipro -p &quot;$(EEPROM)&quot; -w $(PREFIX)$(MAIN)-odd.bin -s

dump:	$(MAIN)
	$(DUMP) $(DUMPFLAGS) $(MAIN).a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;compilation-and-linking&quot;&gt;Compilation and Linking&lt;/h1&gt;

&lt;p&gt;As you can see from the Makefile above I’m using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;m68k-linux-gnu-as&lt;/code&gt; to
assemble the object files from the source files. I am then using
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;m68k-linux-gnu-ld&lt;/code&gt; to link the object file(s) into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.a&lt;/code&gt; archive object
file. Which is then split into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;even&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;odd&lt;/code&gt; ROM binary images needed
for the two 8 bit EEPROMS to make the 16bit wide program data.&lt;/p&gt;

&lt;p&gt;I have a small linker script to handle the vector mapping, the stack and RAM
locations etc. This step makes moving the resources around &lt;em&gt;very&lt;/em&gt; easy, which
I’m now thankful for because the two boards I have are vastly different in
memory map to each other.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MEMORY
{
    ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x10000
    RAM (xrw) : ORIGIN = 0x00040000, LENGTH = 0x10000
}

/* stack location */
stack_size = 1024;

_stack_start = ORIGIN(RAM)+LENGTH(RAM)-0x10;
_stack_end = _stack_start - stack_size;

/* ram location */
_ram_start = ORIGIN(RAM);
_ram_end = ORIGIN(RAM)+LENGTH(RAM);

/* system integration module */
_sim40 = 0x80000;
_timers = _sim40 + 0x600;
_uarts = _sim40 + 0x700;
_dma = _sim40 + 0x780;

SECTIONS {
  .vectors 0x00 :
  {
    . = ALIGN(4);
    KEEP(*(.vectors))
    . = ALIGN(4);
  } &amp;gt; ROM

  .text 0x400 : {
    . = ALIGN(4);
    *(.text)
    . = ALIGN(4);
  } &amp;gt; ROM

  .data : { *(.data) } &amp;gt; RAM
  .bss :  { *(.bss)  *(COMMON) } &amp;gt; RAM
}

OUTPUT_ARCH(m68k)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I’ve been trying to get an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.rodata&lt;/code&gt; section working, but for whatever reason
my sections end up with the wrong alignment and any strings I put there are in
the ROM image, but don’t appear to work. Maybe when I get some times I’ll
figure out why that is, for now I’m happy to just put the strings at the end of
the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.text&lt;/code&gt; section.&lt;/p&gt;

&lt;h1 id=&quot;initializing-the-mc68340-cpu&quot;&gt;Initializing the MC68340 CPU&lt;/h1&gt;

&lt;p&gt;The MC68430 is a great CPU, it has a lovely set of peripherals, and some very
nice features. However getting it going can be a little trick as both the RAM
and ROM positions are controlled completely by the System Integration Module.
The “SIM40” is a peripheral module in the MC68340 that basically handles all
the address decoding and glue logic the other board had in 74 series ICs. This
allows cool things like loading the START and SP registers from the ROM, and
then moving the ROM up high in the memory map and replacing where the ROM would
be with RAM. All with just a few instructions. Done in hardware you’d need
complex gating or a GAL to achieve something similar.&lt;/p&gt;

&lt;p&gt;So to start with here is a chunk of code that configures the ROM and RAM
locations in the memory map, and configures the CPU speed and interrupt maps.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;*************************************************************************
*
*  Init the CPU and System Integration Module - Configs module options
*
.init:
            move.w      #0x2700, %sr                    | mask interrupts and set supervisor mode

            moveq       #7, %d0
            movec       %d0, %dfc
            move.l      #_sim40 + 1, %d0
            moves.l     %d0, 0x3ff00                    | move sim40 base address to 0x80000

            /* setup ROM chip select CS0 */
            move.l      #0x03fffd, _sm_csam0 + _sim40   | 16 bit port, three wait, mask FC bits, 256KB in size
            move.l      #0x000001, _sm_csbar0 + _sim40  | starting at 0x00000

            /* setup RAM chip select CS1 */
            move.l      #0x03fff1, _sm_csam1 + _sim40   | 16 bit port, zero wait, mask FC bits, 256KB in size
            move.l      #0x040001, _sm_csbar1 + _sim40  | starting at 0x40000

            /* setup system protects and clock */
            move.b      #0x06, _sm_sypcr + _sim40       | turn off watchdogs, bus fault, bus monitor
            move.w      #0x7c00, _sm_syncr + _sim40     | set clock to 15.991 MHz
            move.w      #0x420f, _sm_mcr + _sim40       | set MCR, no interrupts etc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this project I’ve just kept the memory map really simple.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;0x000000 is ROM&lt;/li&gt;
  &lt;li&gt;0x040000 is RAM&lt;/li&gt;
  &lt;li&gt;0x080000 is the SIM40 peripherals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I may switch the RAM and ROM around later as this would allow me to dynamically
change the interrupt and trap vectors. Otherwise I have to hard code jumps to
RAM locations inside the ROM where the vectors are in order to make them
dynamic. At the moment I’m not really using interrupts, but I can see myself
wanting too in the near future (also breakpoints etc in my ROM Monitor).&lt;/p&gt;

&lt;h1 id=&quot;initializing-the-mc68340&quot;&gt;Initializing the MC68340&lt;/h1&gt;

&lt;p&gt;The MC68340 has a great suite of peripherals, from UARTs, Timers, System
protection devices and DMA.&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2017-04-26/mc68340.png&quot;&gt;
    
        &lt;img src=&quot;https://fromorbit.com/assets/images/2017-04-26/mc68340.png&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2017-04-26/320-mc68340.png 320w,https://fromorbit.com/assets/images/2017-04-26/640-mc68340.png 640w,https://fromorbit.com/assets/images/2017-04-26/1280-mc68340.png 1280w&quot; alt=&quot;The internals of the MC68340&quot; /&gt;
    
    &lt;/a&gt;
    

&lt;/figure&gt;

&lt;p&gt;The SIM40 modules can move the addresses of these devices where ever you
choose, but the layout is:&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2017-04-26/sim40.png&quot;&gt;
    
        &lt;img src=&quot;https://fromorbit.com/assets/images/2017-04-26/sim40.png&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2017-04-26/320-sim40.png 320w,https://fromorbit.com/assets/images/2017-04-26/640-sim40.png 640w,https://fromorbit.com/assets/images/2017-04-26/1280-sim40.png 1280w&quot; alt=&quot;The SIM40 address structure&quot; /&gt;
    
    &lt;/a&gt;
    

&lt;/figure&gt;

&lt;p&gt;As you can see in the code above I’ve set it to the address of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x080000&lt;/code&gt;. For
this project at the moment I’m turning more stuff &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;off&lt;/code&gt; than I’m turning &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;on&lt;/code&gt;.
By default all these peripherals are available and running, you have to disable
them if you’re not using them. Realistically this is more about power reduction
than anything, but like unused logic gates, I feel they must be put into a
known state. :)&lt;/p&gt;

&lt;p&gt;So I turn off all watchdogs, and system protection peripherals (eg. double bus
fault monitors, bus monitors, reset etc), the timers, and the DMA. Since I need
a UART I configure one and disable the other.&lt;/p&gt;

&lt;h1 id=&quot;the-boot-loader&quot;&gt;The boot-loader&lt;/h1&gt;

&lt;p&gt;Initially I was just going to port across an existing ROM monitor for the m68k,
there are plenty of quality ones out there but given the time I lost on the
faulty CPU/board I quickly realized I won’t be able to port the monitor quickly
enough if I had to burn EEPROMs each time to make any &lt;em&gt;actual&lt;/em&gt; application with
the board. I set out to make an Mandelbrot set with this board, so debugging a
monitor wasn’t something I had time to do.&lt;/p&gt;

&lt;p&gt;So speaking to my friend @trc_wm he suggested getting just something dumb that
dumps binary into RAM and jumps to it, then write some python to push the
binary at the serial port.&lt;/p&gt;

&lt;p&gt;I started implementing that until I saw a few pieces of code that would load
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;srec&lt;/code&gt; format into RAM. I decoded the logic and wrote my own implementation in
a few hours, I figured this would be all round simpler in the long run as I
wouldn’t need to write the python. Instead I could just cut and paste the srec
records straight into the terminal, or at the very least &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cat&lt;/code&gt; them out to the
serial port.&lt;/p&gt;

&lt;p&gt;Here is an example showing altering the code, compiling, copying the srecord
data and running it:&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-26/hello_world.gif&quot; alt=&quot;GIF showing the boot-loader in action&quot; /&gt;&lt;figcaption&gt;
      Demo showing updating code and pushing it to the bootloader

    &lt;/figcaption&gt;&lt;/figure&gt;

&lt;h1 id=&quot;enough-for-today&quot;&gt;Enough for today&lt;/h1&gt;

&lt;p&gt;That ought to do me for today. To achieve my goal of generating a Mandelbrot
set with the board for the Retro Challenge, I’m going to work on either getting
compiling C to run on the m68k, or port a BASIC/FORTH tomorrow and then write a
Mandelbrot set generator in the chosen language.&lt;/p&gt;

&lt;p&gt;We’ll see…&lt;/p&gt;

</description>
        <pubDate>Wed, 26 Apr 2017 00:00:00 +1000</pubDate>
        <link>https://fromorbit.com/2017/04/26/m68k-environment-rc201704.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2017/04/26/m68k-environment-rc201704.html</guid>
        
        
      </item>
    
      <item>
        <title>Rinse Repeat. :( - Retro Challenge 2017/04</title>
        <description>&lt;p&gt;Apart from work and family commitments over Easter I’ve been stuck in a rinse
repeat cycle with this board.&lt;/p&gt;

&lt;p&gt;I am still trying to iron the bugs out, and I’m having weird issues with the
firmware. I started thinking about porting the TS2 “monitor” to this board, but
was having weird issues trying to get the UART to output a string from ROM.&lt;/p&gt;

&lt;h1 id=&quot;im-doing-something-wrong-&quot;&gt;I’m doing something wrong …&lt;/h1&gt;

&lt;p&gt;I then set up a new project just to do a simple test of blinking the LED in a
sequence stored in ROM. It was about this time I started to suspect there was
something wrong with the CPU or the board. Reading a byte from RAM with &lt;em&gt;post
decrement&lt;/em&gt; addressing would work, but trying to do the same in ROM would crash
the CPU. After much stuffing around I finally put out a cry on Twitter and
@brouhaha mentioned that the CPU could be &lt;em&gt;double faulting&lt;/em&gt; and asserting it’s
HALT line. I hadn’t realized this CPU had bidirectional RESET and HALT lines!&lt;/p&gt;

&lt;p&gt;Looking at the schematic I made, I did wonder why the RESET and HALT lines had
resistors in them. It now makes sense given they can drive the lines as well as
take input. So anyway, I stuck my multimeter into the HALT pin when a crash
happened and yes the CPU was double faulting.&lt;/p&gt;

&lt;h1 id=&quot;the-7-stages-of-grief-&quot;&gt;The 7 Stages of Grief …&lt;/h1&gt;

&lt;p&gt;At this point I doubted &lt;em&gt;everything&lt;/em&gt; I spent a week or more trying to solve why
this was happening. I questioned my understanding of m68k assembler, and kept
breaking my testing program down till all I had was basically three
instructions and the problem still existed. I questioned the assembler. I
questioned the linker. I whinged on Twitter, I complained constantly to @trc_vm
via Slack. I then questioned the new EEPROMs I had bought.&lt;/p&gt;

&lt;p&gt;Which this last one may or may not be a real issue, but the previous EPROMs
were 90nS speed rated, and the RAM is 100nS speed rated. These new AT28C256
EEPROMs are a fair bit slower at 150nS, so I desoldered the 12MHz crystal and
under-clocked the CPU to 8MHz to see if that made any difference. In the end it
did, in some small way in that at least now it would appear to fall into the
exception handlers and not just double bus fault all the time. But I still had
my problem with byte loading values from ROM.&lt;/p&gt;

&lt;p&gt;I then started to question “can the m68k actually address bytes, I’m sure it
can” so I scoured all possible resources to confirm it. Then I altered my
program to use words instead of bytes and the damn thing started working!&lt;/p&gt;

&lt;h1 id=&quot;time-to-crack-out-the-logic-analyzer&quot;&gt;Time to crack out the logic analyzer.&lt;/h1&gt;

&lt;p&gt;So now I’m to the point I’m questioning the board or the CPU. So I drag out the
logic analyzer and since I can’t find more than 5 chip clip leads I’m forced to
stuff around to get what I want. I set up my simple small test program to blink
the LED in a sequence stored in the ROM. First blink the LED twice, pause, then
blink the LED three times, pause, etc etc. Eventually up to 8 blinks.&lt;/p&gt;

&lt;p&gt;Run this, I get my two blinks then a locked up LED. I wanted to see what the
ROMs were doing on the 8 bit address read. So I clipped up the RAM/ROM chip
select lines, the even and odd enable lines and the LED output.&lt;/p&gt;

&lt;figure class=&quot;half &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2017-04-18/even.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2017-04-18/even.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2017-04-18/320-even.jpg 320w,https://fromorbit.com/assets/images/2017-04-18/640-even.jpg 640w,https://fromorbit.com/assets/images/2017-04-18/1280-even.jpg 1280w&quot; alt=&quot;The even read&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2017-04-18/odd.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2017-04-18/odd.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2017-04-18/320-odd.jpg 320w,https://fromorbit.com/assets/images/2017-04-18/640-odd.jpg 640w,https://fromorbit.com/assets/images/2017-04-18/1280-odd.jpg 1280w&quot; alt=&quot;The odd read&quot; /&gt;
    &lt;/a&gt;
  
  
    &lt;figcaption&gt;What the logic analyser saw…
&lt;/figcaption&gt;
  
&lt;/figure&gt;

&lt;p&gt;You can easily see the ROM is doing an 8bit read on even, then an 8bit read on
odd.&lt;/p&gt;

&lt;h1 id=&quot;damn-it-this-looks-ok--&quot;&gt;Damn it, this looks OK … :(&lt;/h1&gt;

&lt;p&gt;Suffice to say, I’m at a loss. I re-installed the original factory firmware to
finally see if I wasn’t going bananas. It too failed and entered a double
bus fault. So if the original firmware now fails I’ve somehow damaged the CPU
or the board.&lt;/p&gt;

&lt;p&gt;I’ve found on eBay a few replacement CPU’s for every little money, but they
won’t be here in time for the end of the Retro Challenge. But it does mean I
will get this board going again. I’ve learnt so much playing with it, and my
understanding of GNU binutils etc is so much richer because of it. So perhaps I
can’t get anything going this year for the challenge…&lt;/p&gt;

&lt;h1 id=&quot;-or-can-i&quot;&gt;… or can I?&lt;/h1&gt;

&lt;p&gt;When I rescued this board from the dumpster I also recovered a few others with
it. I picked this board for the Retro Challenge because it seemed the most
approachable; generic MC68HC000; external UARTs and I/O. But it wasn’t the only
board I recovered with a m68k processor on it.&lt;/p&gt;

&lt;p&gt;Enter the AMX AXC-EM with an MC68340RP16 on board!&lt;/p&gt;

&lt;figure class=&quot;half &quot;&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2017-04-18/axc-em.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2017-04-18/axc-em.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2017-04-18/320-axc-em.jpg 320w,https://fromorbit.com/assets/images/2017-04-18/640-axc-em.jpg 640w,https://fromorbit.com/assets/images/2017-04-18/1280-axc-em.jpg 1280w&quot; alt=&quot;AMX AXC-EM board&quot; /&gt;
    &lt;/a&gt;
  
    
    
    &lt;a href=&quot;https://fromorbit.com/assets/images/2017-04-18/mc68340.jpg&quot;&gt;
        &lt;img src=&quot;https://fromorbit.com/assets/images/2017-04-18/mc68340.jpg&quot; sizes=&quot;(max-width: 600px) 100vw, (max-width: 900px) 33vw, 500px&quot; srcset=&quot;https://fromorbit.com/assets/images/2017-04-18/320-mc68340.jpg 320w,https://fromorbit.com/assets/images/2017-04-18/640-mc68340.jpg 640w,https://fromorbit.com/assets/images/2017-04-18/1280-mc68340.jpg 1280w&quot; alt=&quot;MC68340 cpu&quot; /&gt;
    &lt;/a&gt;
  
  
&lt;/figure&gt;

&lt;h1 id=&quot;why-didnt-you-use-this-one-first&quot;&gt;Why didn’t you use this one first?&lt;/h1&gt;

&lt;p&gt;To be honest I wasn’t sure what I wanted, and I was familiar with the
MC68HC000. I also thought having the UARTs and I/O all on chip was cheating.
This board is basically the same thing functionally-wise to the other. It’s
just newer and with an ‘020 based CPU. Basically all the same hardware is on
board. Two UARTs, an LED, 8 DIP switches, battery backup RAM, clock/calendar,
etc etc. It’s still from 1992 so it fits the Challenge. :)&lt;/p&gt;

&lt;p&gt;So yeah, now I start again basically. I have to figure out the memory map, the
device layout and the differences with an ‘020 versus a vanilla 68000. Dear god
I hope it can read bytes from ROM!&lt;/p&gt;

</description>
        <pubDate>Tue, 18 Apr 2017 00:00:00 +1000</pubDate>
        <link>https://fromorbit.com/2017/04/18/rinse-repeat-rc201704.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2017/04/18/rinse-repeat-rc201704.html</guid>
        
        
      </item>
    
      <item>
        <title>Now we&apos;re get&apos;n somewhere! - Retro Challenge 2017/04</title>
        <description>&lt;p&gt;After the UV fiasco I’ve finally managed to get around the issue. I did that by
ditching EPROMs and instead replaced them with EEPROMs!&lt;/p&gt;

&lt;p&gt;Rummaging around in the shed I found two other cards from the system this
controller was in originally. They were for controlling infrared devices and
what not and used a M68HC11 CPU. They had 27C64 EPROMs and 28C64s EEPROM each.&lt;/p&gt;

&lt;p&gt;My guess is that rather than adding battery backed up RAM on these smaller
cards, AMX opted just to use the 28C64 as SRAM since the write performance etc
of them are pretty good. These smaller cards really didn’t store much other
than configuration data and they would’ve just used the internal 768 bytes of RAM
on chip and just set the 28C64 up as an external 8KB of non-volatile RAM.&lt;/p&gt;

&lt;p&gt;Anyway, I found them and thought “Hmmm a blinking LED doesn’t need 64KBs
(2x32KB) of ROM to work, 16KBs (2x8KB) should be ample”. The only real issue I
had was that I only had two and they were from different manufacturers. I wasn’t
sure if this would cause an issue or not but I figured it would be worth a
try.&lt;/p&gt;

&lt;h1 id=&quot;a-try-&quot;&gt;A try …&lt;/h1&gt;

&lt;p&gt;The 28C64s are basically almost pin compatible with the 27C256s (obviously
missing the two additional address lines.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2017-04-08/eeprom_vs_eprom1.png&quot; alt=&quot;Pin outs of a 28C64 and a 27C256&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So apart from A14, A13 and the VPP signal these would plug straight in. Woo hoo
I was thinking, this’ll be easy!&lt;/p&gt;

&lt;p&gt;I set to work. I wanted to replace the crappy single leaf sockets that are on
this board, but I wasn’t willing to do all of them in one hit. The PCB traces
on the thicker tracks have started that weird bubbling/lifting thing that
things of this vintage start to do. I figured it would be safer if I just did
one set at a time. So I carefully desoldered the two sockets and replaced them
with machine pin sockets…&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-08/sockets_gone.jpg&quot; alt=&quot;Removed the sockets&quot; /&gt;&lt;figcaption&gt;
      Old sockets be gone!

    &lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;It was at this time that I noticed pin 1 on these sockets had traces. Given
these are the VPP lines I thought that was strange. It turns out they’re
actually connected to A16! This isn’t a problem (yet) as the VPP lines require
high voltage to do anything.&lt;/p&gt;

&lt;p&gt;The solution I came up with to make the 28C64s work without their write enable
line being connected to A14 was to add another layer of machine pins with the
sockets missing.&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-08/adapters_in_place.jpg&quot; alt=&quot;Adapters in place&quot; /&gt;&lt;figcaption&gt;
      Adapters in place

    &lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;I opted to pull out the VPP, A13 and A14 pins just to make sure. I then
programmed my blink routine into the two mismatched 28C64s and expected great
things to happen… And they did… briefly…&lt;/p&gt;

&lt;h1 id=&quot;the-led-blinked-sometimes&quot;&gt;THE LED BLINKED!… sometimes.&lt;/h1&gt;

&lt;p&gt;After all the hassle with the EPROMS and UV light etc I &lt;em&gt;finally&lt;/em&gt; had the
little LED blink. The only issue was that it wouldn’t do it consistently.
Sometimes it would blink 4 or 5 times then stop, other times it would blink
once and stay on, and others it just wouldn’t blink at all. :(&lt;/p&gt;

&lt;p&gt;I started to suspect that possibly different timings with the EEPROMs vendors
and that the CPU was only &lt;em&gt;sometimes&lt;/em&gt; getting it’s stars to align well enough
for the LED to blink for a few cycles etc before it got all jammed up. I wasn’t
too disappointed as I knew my element14 delivery was arriving in the morning
with my new AT28C256’s and the fact I got the board to do &lt;em&gt;anything&lt;/em&gt; was a
total win in my book at this point.&lt;/p&gt;

&lt;p&gt;I posted on twitter about my success and went to bed late, trying not to
disturb my lovely wife once again.&lt;/p&gt;

&lt;h1 id=&quot;something-fishy-is-going-on&quot;&gt;Something fishy is going on.&lt;/h1&gt;

&lt;p&gt;Through my following working day I kept being suspicious of the timing
conclusion I’d drawn myself into. It was odd that the CPU would process
hundreds of thousands of instruction reads from these EEPROMs inside the delay
loop code before “magically” the timing of the EEPROMs would became an issue
and ruined the whole thing. That started to sound very very unlikely to me. It
just didn’t make sense.&lt;/p&gt;

&lt;p&gt;I then started thinking about the code, and how the interrupt and error vectors
where not set correctly in the early part of the ROM code. So if the CPU had an
external interrupt triggered by some of the other uninitialized hardware, the
CPU could be falling into an ISR that didn’t exist and lock up.&lt;/p&gt;

&lt;p&gt;This started to sound more and more likely to me, so once I finished work for
the day I set about properly configuring the interrupt vector table and
cleaning up my horrible testing code.&lt;/p&gt;

&lt;p&gt;I wanted the code to be relocatable and the vector table be properly configured
using a linker script so that I can link up a bunch of objects and have the
magic of linking work with me rather than it just being a dumb copy-it-here type
deal.&lt;/p&gt;

&lt;h1 id=&quot;building-the-code-environment&quot;&gt;Building the code environment.&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/alangarf/amx_axc_m68k&quot;&gt;https://github.com/alangarf/amx_axc_m68k&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After much frustration trying to figure out why &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ld&lt;/code&gt; was overwriting my new
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.vector&lt;/code&gt; section and my general lack of understanding of a lot of what the
linker does I enlisted the help of my dear friend
&lt;a href=&quot;https://twitter.com/trc_wm&quot;&gt;Niels&lt;/a&gt; to help point me in the right direction.&lt;/p&gt;

&lt;p&gt;Together we figured out my &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.section&lt;/code&gt; in my assembly code didn’t have the right
flags set so &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ld&lt;/code&gt; wasn’t loading the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.vector&lt;/code&gt; section into the output. Rightly
so because it thought it didn’t have to.  After we figured that out the vectors
where properly being set, and I had a workable development setup to continue on
with.&lt;/p&gt;

&lt;p&gt;I later discovered that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;objcopy&lt;/code&gt; also can generate interleaved binary files
just for the purpose of creating ROM files for systems like this one. So rather
than using some dodgy python I wrote quickly to split the resulting binary ROM
image in half, I simply made &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;objcopy&lt;/code&gt; create an &lt;em&gt;even&lt;/em&gt; and an &lt;em&gt;odd&lt;/em&gt; ROM
image!&lt;/p&gt;

&lt;p&gt;Suitably chuffed with myself at this point.&lt;/p&gt;

&lt;h1 id=&quot;at28c256s-arrive&quot;&gt;AT28C256s arrive!&lt;/h1&gt;

&lt;p&gt;Again, element14 in Sydney amaze me. My AT28C256s were ordered at 5:30PM the
day before, and arrived at my door in country NSW Australia by lunch time the
next day. I’m about 5 hours drive away from their warehouse (I used to live
near their warehouse and boy it was useful), so it’s truly amazing how quickly
I can get parts from them.&lt;/p&gt;

&lt;p&gt;Anyway, deciding for a quick win I didn’t bother creating a pin swapping socket
for these new chips. I figured I’d just use only the first 8KB of them and drop
them into the existing sockets I had for the 28C64s.&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-08/at28c256s_in_place.jpg&quot; alt=&quot;AT28C256s in place&quot; /&gt;&lt;figcaption&gt;
      AT28C256s in place

    &lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;I realized after plugging them in that had I not removed the VPP lines from
these sockets that I would’ve connected A16 to the A14 pin on these EEPROMs,
which would’ve allowed for 16KBs of ROM split across 0x0000 -&amp;gt; 0x3FFF and
0x8000 -&amp;gt; 0xBFFF.&lt;/p&gt;

&lt;p&gt;But more importantly when I do properly do the pin swap to make these into a
continuous 64KB address space the write enable pin would end up at the VPP
position which now I know has A16 attached to it!&lt;/p&gt;

&lt;p&gt;This could’ve had &lt;strong&gt;all sorts&lt;/strong&gt; of weird consequences had I not known that now!&lt;/p&gt;

&lt;h1 id=&quot;so-did-it-work&quot;&gt;So did it work?&lt;/h1&gt;

&lt;p&gt;I powered up the board with the new EEPROMs and the updated code and &lt;strong&gt;success&lt;/strong&gt;
it blinked perfectly, a nice solid consistent blink…&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-08/blinking1.gif&quot; alt=&quot;Blink you good thing!&quot; /&gt;&lt;figcaption&gt;
      Blink you good thing!

    &lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;… until I lifted the board.&lt;/p&gt;

&lt;h1 id=&quot;ugh-youre-kidding-me&quot;&gt;UGH, you’re kidding me.&lt;/h1&gt;

&lt;p&gt;It seems like the issue I had with the other 28C64s wasn’t timing or bad code,
it was a plain and simple dry joint somewhere on this board causing all the
issues. :(&lt;/p&gt;

&lt;p&gt;I mean expecting a 27 year old board that spent at least 10 years bouncing
around my garage to have no damage after all this time probably was a little
naive.&lt;/p&gt;

&lt;p&gt;When testing the manufacturers firmware via a serial terminal I remember
noticing initially that sometimes the board wouldn’t boot properly or it would
crash sometimes. But even then I attributed this to a bad serial lead or the
shitty terminal emulator I had on my Windows machine in the shed.&lt;/p&gt;

&lt;p&gt;So, now I have a treasure hunt on my hands. Is it a bad solder joint, or a
cracked trace somewhere on the board. I’m going to start with resolding all the
connections first, then I’ll start looking more closely at the traces. The main
issue I have is that a &lt;strong&gt;lot&lt;/strong&gt; of the traces are hidden under sockets and
immovable devices so that could be fun. BUT at least now I have a working board
with a known issue. If I giggle the board just so I can make it work reliably.
So that’s a win in my book!&lt;/p&gt;

&lt;h1 id=&quot;what-else-have-you-done-though-what-about-that-schema&quot;&gt;What else have you done though, what about that schema?&lt;/h1&gt;

&lt;p&gt;Yeah I’ve updated the schematic some more, apart from the level conversion of
the RS232 port I’ve got the entire schematic done now. You can get the KiCAD
files from: &lt;a href=&quot;https://github.com/alangarf/amx_axc_kicad&quot;&gt;https://github.com/alangarf/amx_axc_kicad&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/images/2017-04-08/schematic.png&quot; class=&quot;align-center&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-08/schematic.png&quot; alt=&quot;The schematic&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;is-that-all&quot;&gt;Is that all?&lt;/h1&gt;

&lt;p&gt;Yeah I think that’ll do for today. :)&lt;/p&gt;

</description>
        <pubDate>Sat, 08 Apr 2017 00:00:00 +1000</pubDate>
        <link>https://fromorbit.com/2017/04/08/gettin-somewhere-rc201704.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2017/04/08/gettin-somewhere-rc201704.html</guid>
        
        
      </item>
    
      <item>
        <title>Ugh! I need UV - Retro Challenge 2017/04</title>
        <description>&lt;p&gt;So I set out to make the LED blink a merry blink tonight, but was finally thwarted when I came to the realisation I’d need UV light to erase the EPROMs to load my code in. Suffice to say this was mighty frustrating.&lt;/p&gt;

&lt;p&gt;I’m getting ahead of the story, so let’s start from the beginning&lt;/p&gt;

&lt;h1 id=&quot;the-beginning&quot;&gt;The beginning&lt;/h1&gt;

&lt;p&gt;Starting tonight with a goal to have “something” running on this board before I went to bed I started sorting out my development environment. Setting up the required software and tools to get the job done so to speak.&lt;/p&gt;

&lt;p&gt;I installed all the GNU m68k tools. I made a nice little Makefile to assemble my assembly…&lt;/p&gt;

&lt;div class=&quot;language-make highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;M68K&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;m68k-linux-gnu
&lt;span class=&quot;nv&quot;&gt;AS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$(M68K)&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-as&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;LD&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$(M68K)&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ld&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;DUMP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$(M68K)&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-objdump&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;START&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0x00
&lt;span class=&quot;nv&quot;&gt;FMT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;binary
&lt;span class=&quot;c&quot;&gt;#FMT=ihex
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CPU&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-m68000&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;SRCS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;blink.s
&lt;span class=&quot;nv&quot;&gt;OBJS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$(SRCS:.s=.o)&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;MAIN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;blink.bin

&lt;span class=&quot;nl&quot;&gt;.PHONY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;dump clean&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;all&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;    &lt;span class=&quot;nf&quot;&gt;$(MAIN)&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;@echo&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;Builds&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;blink.bin&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;$(MAIN)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;$(OBJS)&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;$(LD)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$(START)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;--oformat&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$(FMT)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$(MAIN)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$(OBJS)&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;.s.o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;$(AS)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$(CPU)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$@&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&amp;lt;&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;clean&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;*.o&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$(MAIN)&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;dump&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;   &lt;span class=&quot;nf&quot;&gt;$(MAIN)&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;$(DUMP)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$(CPU)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;--disassemble-all&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;--target&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$(FMT)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--start-address&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$(START)&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$(MAIN)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I even bashed together a little test program to twiddle the LED bit of the 74LS259…&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/*
 * Blink LED connected to 74LS259 output.
 *
 * ROM is at 0x00000-0x0FA00.
 * RAM is at 0x20000-0x2FA00
 * 74LS259 is at 0x60000.
 */

.equ PORT, 0x60000

/* Iterations of delay loop before updating output value */
.equ DELAY, 50000

.org 0
    /* set initial SSP (supervisor stack pointer) */
    .byte 0, 0, 0, 0

    /* set the program counter */
    .byte 0, 0, 4, 0

.org 0x400
    move.l #PORT, %a0

.top:
    move.b #0x0E, %d0   /* set Q7 to low in the addressable latch mode */
    move.b %d0, (%a0)   /* write to &apos;LS259 */

    move.l #DELAY, %d1
.delay1:
    tst.l %d1
    beq .delay1end
    subq.l #1, %d1
    jmp .delay1

.delay1end:
    move.b #0x0F, %d0   /* set Q7 to high in the addressable latch mode */
    move.b %d0, (%a0)   /* write to &apos;LS259 */

    move.l #DELAY, %d1
.delay2:
    tst.l %d1
    beq .delay2end
    subq.l #1, %d1
    jmp .delay2

.delay2end:
    jmp .top

.org 0xFFFA
    jmp .top
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And like a late night TV shopping channel ad I’ll even throw in a &lt;del&gt;free set of steak knives&lt;/del&gt; tool to split the resulting binary into 32KB interleaved chunks so they’d work on the board.&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/python3
&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;os&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;argparse&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;parser&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;argparse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ArgumentParser&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;parser&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_argument&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;src&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parser&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parse_args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;even_fn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;even-{}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;odd_fn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;odd-{}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;rb&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;even_fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;wb&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;even&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;odd_fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;wb&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;odd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;seek&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SEEK_END&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;src_size&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;seek&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

            &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;src_size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;seek&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
                    &lt;span class=&quot;n&quot;&gt;odd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
                    &lt;span class=&quot;n&quot;&gt;even&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Also buy one get one free; I upgraded the software for the Minipro TL866 on OSX. I even figured out the magic device type for my EPROMs.&lt;/p&gt;

&lt;h1 id=&quot;then-it-happened&quot;&gt;Then it happened…&lt;/h1&gt;

&lt;p&gt;I went and tried to write the first “even” binary to the EPROM…&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ minipro -p &quot;27C256 @DIP28 #2&quot; -w even-blink.bin
Found Minipro TL866A v03.2.72
Chip ID OK: 0x298c
Writing Code... OK
Reading Code... OK
Verification failed at 0x200: 0x20 != 0x00
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p class=&quot;notice--danger&quot;&gt;COMPUTER SAYS NO...&lt;/p&gt;

&lt;h1 id=&quot;beware-losing-all-hope&quot;&gt;Beware, losing all hope…&lt;/h1&gt;

&lt;p&gt;Damn it! I forgot I need to erase these things first.&lt;/p&gt;

&lt;p&gt;Hunting around the garage for any source of UV I knew my search was futile. I even resorted to madness when I found a big bag of “UV” LEDs.&lt;/p&gt;

&lt;figure class=&quot;&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-06/uv_madness.png&quot; alt=&quot;Silly pic of UV LED trying to erase EPROM&quot; /&gt;&lt;figcaption&gt;
      UGH, my world for some UV

    &lt;/figcaption&gt;&lt;/figure&gt;

&lt;h1 id=&quot;so-now-what&quot;&gt;So, now what…&lt;/h1&gt;

&lt;p&gt;Well I’ll need to figure out a source of UV. However I also figured I’d just buy some newer flash based EEPROMs in the mean time. Element14 have them in stock locally and I should see them before the weekend hopefully.&lt;/p&gt;

&lt;p&gt;I ordered two &lt;a href=&quot;http://www.microchip.com/wwwproducts/en/AT28C256&quot;&gt;AT28C256&lt;/a&gt;s, which are 98% pin compatible and fast enough for this board. I need to hack a pin swap between pin 1 and 27, but that’s a small price to pay I guess.&lt;/p&gt;

&lt;p&gt;Still very disappointed, and my wife is likely to kill me when I sneak into bed at 1:00am. Wouldn’t be so bad if I had the taste of victory instead of the bitter pill of defeat.&lt;/p&gt;

&lt;p&gt;I put up a good fight.&lt;/p&gt;

&lt;p&gt;But UV got the better of me.&lt;/p&gt;

&lt;p&gt;Here’s to tomorrow!&lt;/p&gt;
</description>
        <pubDate>Thu, 06 Apr 2017 00:00:00 +1000</pubDate>
        <link>https://fromorbit.com/2017/04/06/m68k-why-no-uv-rc201704.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2017/04/06/m68k-why-no-uv-rc201704.html</guid>
        
        
      </item>
    
      <item>
        <title>Got together a schematic today - Retro Challenge 2017/04</title>
        <description>&lt;p&gt;Quick one today, I worked on the schematic a little more. Still a few unknowns
and a couple of holes I’ve not filled in yet, but the schematic is 80%
complete. At least to a point where I can get a ROM monitor etc running and
know where all the hardware is and have a good certainty I’m not talking in the
breeze when I start trying to control the hardware.&lt;/p&gt;

&lt;p&gt;I’ve also been working on a simulator for this board using the &lt;a href=&quot;https://github.com/kstenerud/Musashi&quot;&gt;Musashi 68000
core&lt;/a&gt; in C. I’ve built up the address
map, and started writting modules to simulate the hardware. This will help me
greatly in development as I won’t need to be burning ROMs so often to try
things out initially. A ROM monitor would help a lot too, so I’m weighing up
options given the time I have for the competition and my already terrible
work/life balance.&lt;/p&gt;

&lt;p&gt;Here is a snippet of the UART core I’ve written for the simulator, it sets up the internal registers etc of the UART so the firmware can read and write state to configure the registers. The only bit I’ve not successfully worked out yet is the interrupt priorities, there is something wonky on this boards layout I’ve not figured out with the interrupt. But that’s another days problem.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;scc2691_core uarts[2];

void scc2691_reset(void)
{
    for(int i = 0; i &amp;lt; 2; i++) {
        uarts[i].id = i;

        uarts[i].m1 = 0x0;
        uarts[i].m1_flag = 0x0;
        uarts[i].m2 = 0x0;

        uarts[i].csr  = 0x0;
        uarts[i].cr   = 0xA;
        uarts[i].thr  = 0x0;
        uarts[i].acr  = 0x0;
        uarts[i].imr  = 0x0;
        uarts[i].ctur = 0x0;
        uarts[i].ctlr = 0x0;

        uarts[i].sr  = 0x0;
        uarts[i].rhr = 0x0;
        uarts[i].isr = 0x0;
        uarts[i].ctu = 0x0;
        uarts[i].ctl = 0x0;

        uarts[i].cnt_flag = 0;
        uarts[i].cnt_value = 0;

        uarts[i].tx = 0;
        uarts[i].tx_last = time(NULL);
        int_controller_clear(1);
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;the-schematic-so-far-&quot;&gt;The schematic so far …&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;/assets/images/2017-04-05/schematic.png&quot; class=&quot;align-center&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-05/schematic.png&quot; alt=&quot;AMX board schematic&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Wed, 05 Apr 2017 00:00:00 +1000</pubDate>
        <link>https://fromorbit.com/2017/04/05/m68k-schematic-rc201704.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2017/04/05/m68k-schematic-rc201704.html</guid>
        
        
      </item>
    
      <item>
        <title>Beeping out the board - Retro Challenge 2017/04</title>
        <description>&lt;p&gt;I first started with this board by pulling off the ROMs and dumping their contents. Being a m68k CPU generally the ROMs are split into odd and even byte streams, and in order to dissassemble them the two ROM images need to be interleaved again. I achieved this with a little bit of python:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#!/usr/bin/python3

import os
import argparse

parser = argparse.ArgumentParser()
parser.add_argument(&quot;odd_file&quot;)
parser.add_argument(&quot;even_file&quot;)
parser.add_argument(&quot;output&quot;)
args = parser.parse_args()

with open(args.output, &apos;wb&apos;) as out:
  with open(args.odd_file, &apos;rb&apos;) as odd:
    with open(args.even_file, &apos;rb&apos;) as even:

      odd.seek(0, os.SEEK_END)
      odd_size = odd.tell()

      even.seek(0, os.SEEK_END)
      even_size = even.tell()

      if (odd_size != even_size):
        exit(&quot;ROM images aren&apos;t the same size!&quot;)

      odd.seek(0)
      even.seek(0)

      for c in range(0, odd_size):
        odd.seek(c)
        even.seek(c)

        out.write(odd.read(1))
        out.write(even.read(1))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;roming-around-like-its-1995&quot;&gt;ROMing around like it’s 1995&lt;/h1&gt;

&lt;p&gt;I took the two ROM images I dumped and merged them back together using the following:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ merge.py rom_odd.bin rom_even.bin rom_out.bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After verifying the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rom_out.bin&lt;/code&gt; using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;objdump&lt;/code&gt; for the m86k I knew I was on my way.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ m68k-linux-gnu-objdump --disassemble-all --target=binary --architecture=m68k --start-address=0x00 rom_out.bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This gave me the disassembled output of the m68k ROM image:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rom_out.bin:     file format binary


Disassembly of section .data:

00000000 &amp;lt;.data&amp;gt;:
       0:	0002 0ff0      	orib #-16,%d2
       4:	0000 0400      	orib #0,%d0

[SNIP]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The first value is the preset value the CPU uses for the SP (stack pointer). So
it looks like it’s up in 0x20000 address space. That’s a good start, looks like
some RAM is up around 0x20000.&lt;/p&gt;

&lt;p&gt;The second address is the init jump point, so the first instruction the CPU
will load is at location 0x400.&lt;/p&gt;

&lt;h1 id=&quot;the-stuff-you-see-in-rom-dumps-&quot;&gt;The stuff you see in ROM dumps …&lt;/h1&gt;

&lt;p&gt;Further digging through the assembly and looking at hex dumps you can start to
see strings (even some funny stuff) and loops testing devices and memory etc.&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;00009140: 3131 2100 2a21 3132 2100 5041 5353 0053  11!.*!12!.PASS.S
00009150: 454e 4420 434f 4d4d 414e 4400 5345 4e44  END COMMAND.SEND
00009160: 2053 5452 494e 4700 5055 5348 0056 414c   STRING.PUSH.VAL
00009170: 5545 204f 4600 4445 5649 4345 2053 5441  UE OF.DEVICE STA
00009180: 5455 5300 5245 4345 4956 4520 5052 4f47  TUS.RECEIVE PROG
00009190: 5241 4d00 4841 5645 2050 524f 4752 414d  RAM.HAVE PROGRAM
000091a0: 0053 484f 5720 4445 5649 4345 0043 4f4d  .SHOW DEVICE.COM
000091b0: 5041 5245 2044 4556 4943 4500 5348 4f57  PARE DEVICE.SHOW
000091c0: 2049 4e50 5554 204f 4e00 5348 4f57 2049   INPUT ON.SHOW I
000091d0: 4e50 5554 204f 4646 0041 4d58 2042 5547  NPUT OFF.AMX BUG
000091e0: 003f 0048 454c 5000 4441 5445 0054 494d  .?.HELP.DATE.TIM
000091f0: 4500 5345 5420 4441 5445 0053 4554 2054  E.SET DATE.SET T
00009200: 494d 4500 5645 5253 494f 4e00 4d45 4d4f  IME.VERSION.MEMO
00009210: 5259 0053 4c4f 5400 4841 5645 2043 4f4e  RY.SLOT.HAVE CON
00009220: 5452 4f4c 0053 5953 5445 4d20 5245 5345  TROL.SYSTEM RESE
00009230: 5400 4543 484f 204f 4e00 4543 484f 204f  T.ECHO ON.ECHO O
00009240: 4646 0053 4849 5400 4655 434b 0048 454c  FF.SHIT.FUCK.HEL
00009250: 4c4f 003e 004f 4b00 434f 4e4e 4543 5400  LO.&amp;gt;.OK.CONNECT.
00009260: 5249 4e47 0043 4152 5249 4552 0045 5252  RING.CARRIER.ERR
00009270: 4f52 0044 4941 4c54 4f4e 4500 4255 5359  OR.DIALTONE.BUSY
00009280: 0000 4e56 fffe 422e ffff 4a39 0002 140b  ..NV..B...J9....
00009290: 6712 7000 1039 0002 140b 41f9 0002 140c  g.p..9....A.....
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;beep-beep-beeeeeeeeeep-&quot;&gt;Beep, beep, beeeeeeeeeep …&lt;/h1&gt;

&lt;p&gt;After much looking through the code I had some good ideas where things were but I still didn’t fully understand the address map of the CPU and what devices were going where. So being all DIP packages and only a dual layer board I set out with my Fluke 87 and my pointest of pointy probes and started beeping out traces on the board to get a true account of where all the devices are and what they do.&lt;/p&gt;

&lt;p&gt;I start building up a picture in KiCad of the schematic. Not taking values of components etc, but just the general connections so that many things can become much clearer. I first tackled the address decoding.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/images/2017-04-03/address-decoding.png&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-03/tmb_address-decoding.png&quot; alt=&quot;AMX AXC 68000 address decoding&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So after a lot of beeping and probing I got the address map out:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;| 0x00000       | ROM                    |
| 0x10000       | ROM (addr alias?)      |
| 0x20000       | RAM BANK 1             |
| 0x30000       | RAM BANK 2             |
| 0x40000       | UARTs (2 x SCC2691)    |
| 0x50000       | INPUTs via a 74LS373   |
| 0x60000       | OUTPUTs via a 74LS259  |
| 0x70000       | INPUT via a 74LS373    |
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The first INPUT and OUTPUT addresses are related to the OKI M5832 clock calendar chips 4 bit I/O bus and control lines, and the on-board green status LED. So that’s a good start.&lt;/p&gt;

&lt;p&gt;Need to understand the UARTs a little better, one is standard RS232 the other is a weird RS485 like interface (called AXLink in AMX speak).&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/images/2017-04-03/axlink_bus.png&quot;&gt;&lt;img src=&quot;/assets/images/2017-04-03/tmb_axlink_bus.png&quot; alt=&quot;AXLink bus schematic&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyway, that’s all for today. I’ll crack on with more tomorrow!&lt;/p&gt;

</description>
        <pubDate>Mon, 03 Apr 2017 00:00:00 +1000</pubDate>
        <link>https://fromorbit.com/2017/04/03/m68k-amx-board-rc201704.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2017/04/03/m68k-amx-board-rc201704.html</guid>
        
        
      </item>
    
      <item>
        <title>Retro Challenge 2017/04</title>
        <description>&lt;p&gt;After working with a friend on a Z80 based project I spoke about some SCC2691
UARTs I had from an old board I had saved from a skip bin some 10 years ago. He
asked questions about the board and I described it to him..&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Yeah it’s got a 68000 on it, with what looks like 64KBs of RAM and I don’t
know 32KB or ROM. Looks like there is a clock chip, dual batteries probably
for the clock maybe the RAM, and what looks like a standard RS232 port.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;He quickly said I’d be nuts to tear the board apart and it would make a good
candidate for the RetroChallenge competition. So after very little thought I
considered this as something that might be fun to do. So of course…&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/images/2017-03-31/amx_axc_master.png&quot;&gt;&lt;img src=&quot;/assets/images/2017-03-31/tmb_amx_axc_master.png&quot; alt=&quot;AMX AXC 68000
Board&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;retrochallenge&quot;&gt;Retrochallenge&lt;/h2&gt;

&lt;p&gt;My already busy life schedule has just gotten busier for the next month. I have
successfully entered the 2017/04 challenge and intend to set to work on the 1st
of April.&lt;/p&gt;

&lt;p&gt;My goals for this project are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Reverse engineer the board.
    &lt;ul&gt;
      &lt;li&gt;Work out the memory map and the devices and peripherals on the board.&lt;/li&gt;
      &lt;li&gt;Build enough schematic of the board to understand all the little trick it
might hold.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Build a software simulator for the board using &lt;a href=&quot;https://github.com/kstenerud/Musashi&quot;&gt;a m68k simulator CPU&lt;/a&gt;.
    &lt;ul&gt;
      &lt;li&gt;This will include getting the boards own firmware running.&lt;/li&gt;
      &lt;li&gt;Setup a ROM monitor.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Get a ROM monitor going on the board.
    &lt;ul&gt;
      &lt;li&gt;Get the onboard the devices working (calendar, UARTs, LED).&lt;/li&gt;
      &lt;li&gt;Get either BASIC or a FORTH interpreter working.&lt;/li&gt;
      &lt;li&gt;Write a Mandelbrot set program.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’d like to see what can be done with the battery backed up RAM. Perhaps
getting a small OS running would be interesting. Adding additional hardware
will be difficult as there is no “bus expansion” onboard so any additional
hardware would have to sit ontop of the board and replace the RAM or something
to access the address and data lines. But that’s not really going to be part of
the challenge. Just getting a ROM monitor etc will be hard enough. :)&lt;/p&gt;

</description>
        <pubDate>Fri, 31 Mar 2017 00:00:00 +1100</pubDate>
        <link>https://fromorbit.com/2017/03/31/retro-computing-challenge-201704.html</link>
        <guid isPermaLink="true">https://fromorbit.com/2017/03/31/retro-computing-challenge-201704.html</guid>
        
        
      </item>
    
  </channel>
</rss>
