SD card and Ethernet on the Amiga 1200

It’s been a while since I last did any retro-computing stuff, but when someone contacted me recently asking for permission to use some of my VHDL in an open-source accelerator project for the Amiga 1200 my attention was grabbed.

The A1200 was the second Amiga I owned back in the 90s.  This is a Motorola 68EC020 based machine running at 14.2 MHz – twice the clock speed of the older Amigas.  As luck would have it I still had the A1200 in storage, and after replacing some capacitors and cleaning things up a bit it was back in full working order, so I agreed to help out…

The K1208 board by kipper2k was originally based on the open-source Terrible Fire CD32 board by Stephen Leary (who was responsible for porting my BBC micro implementation to Xilinx), but is updated with a number of additional features and a larger CPLD.  It contains a pair of Xilinx XC95xx CPLDs, chosen for their 5 V support, 8MB of 32-bit DRAM, a real-time-clock chip and two SPI ports.  One of the SPI ports has a dedicated connection to a micro-SD card slot, and the other is designed for third-party peripherals – in particular the ENC28J60 ethernet interface.

Having been kindly sent a K1208 to work on I set about re-implementing the logic from scratch, partly as an exercise to reacquaint myself with the Amiga architecture, and to add the missing pieces needed to support the SPI hardware and interrupt support needed for decent network performance.

To support the board, two Amiga device drivers were also written.  These need to be copied to DEVS:.

spisd.device adds support for micro SD cards in the on-board slot.  It should work with any filesystem driver but has been tested with fat95.  The image on the left shows the performance as measured with SysInfo, which is reasonable for a serially accessed device (the SPI bus is running at half the CPU clock speed; 7.1 MHz).

spinet.device is perhaps the more interesting of the two, adding support for cheap ENC28J60 ethernet modules that can be found on eBay.  This is a SANA2 driver that should work with any of the Amiga’s TCP/IP stacks, but which was developed with Miami and has also been tested with Roadshow.  The driver makes full use of interrupts so it is important to make sure this pin is connected to the ENC28J60 device.

Development of the ethernet driver deserves a post in its own right, since documentation on SANA2 is somewhat limited and a number of challenges were encountered during development of the driver.

The VHDL source for the CPLDs and the source for the drivers are all released under GPLv3 and can be found on my GitHub page.

To get up and running quickly you can also download pre-compiled binaries:

Many thanks to kipper2ksolidcorefreemilk and Chucky for supplying hardware and for help with testing.

Edit 7 May 2018:  It was pointed out that the SANA2 header file does not have a GPL-compatible licence on it, so that file has been removed from the device drivers repository.  You can still build the network driver if you find sana2.h and place it in ‘net’ yourself.  As the API is published I will get around to writing a GPL-clean header at some point.

Leave a Reply

Your email address will not be published. Required fields are marked *