BMOW title
Floppy Emu banner

68 Katy

68-katy-breadboard  68katy-pcb

68 Katy is a hand-built computer based upon a Motorola 68K series CPU, and designed to run the Linux OS. The initial 2 MHz prototype was constructed on a solderless breadboard, and a later PCB version runs at 12 MHz. The operating system is a customized version of uClinux with the 2.0.39 kernel from 2004, squeezed into just 467K. It’s a full-fledged multitasking OS, and even runs vi and the classic Colossal Cave Adventure! A small monitor/bootloader program acts as a companion to uClinux, and can be used to load bare-metal programs or to update the contents of the flash ROM.

Both the breadboard and PCB versions feature 512K flash ROM, 512K SRAM, and a USB serial port. The heart of the design is a 68008 CPU, a low-cost version of the more familiar 68000 CPU that has an 8-bit data bus instead of 16-bit. Curious readers may wonder how Linux can run on a 68008 CPU, which lacks a memory management unit and can’t support virtual memory. Fortunately uClinux is specifically designed for such “no MMU” architectures. Of course with no MMU there’s no memory protection, so a buggy program can wreak havoc in other running programs, or even crash the whole OS – just like in the good old days.

Much more background about the original “Linux on a breadboard” prototype and the process of building it can be found on this page. For full details, see the postings in the 68 Katy build log.

Here’s a video of the prototype machine booting uClinux and running through its paces:

The breadboard prototype (2 MHz) versus the PCB version (12 MHz):

 
Memory Map

BREADBOARD 68 KATY               PCB 68 KATY
00000 - 77FFF : ROM              00000 - 77FFF : ROM
78000 - 79FFF : serial in        78000 - 79FFF : serial in
7A000 - 7BFFF : serial out       7A000 - 7BFFF : serial out
7C000 - 7DFFF : serial status    7C000 - 7CFFF : serial status RDF
                                 7D000 - 7DFFF : serial status TXE
7E000 - 7FFFF : LED register     7E000 - 7FFFF : LED register
80000 - FFFFF : RAM              80000 - FFFFF : RAM

 
PCB Version

The PCB version is the easiest way to build your own 68 Katy. It replaces all of the glue logic, timers, and other miscellaneous components with a single CPLD. Compared with the breadboard version, the number of status LEDs is reduced from eight to one, and there’s a small change to the serial status address mapping. Get a PCB, solder the components, burn the ROM, and you’ll be in business.

Assembling the PCB requires soldering one surface mount component, the 44 pin CPLD in TQFP package. It can be soldered with a standard iron using the drag soldering method (my preference), with hot air, or with a toaster oven reflow. The rest of the components are easy through-hole parts.

You’ll need an EPROM burner to program the initial flash ROM data, as well as a JTAG programmer for the CPLD. I used a Bus Pirate with the XSVF player firmware to program the CPLD.

Note that the PCB and Breadboard versions of 68 Katy are not binary compatible, due to a small difference in their memory maps. If you’re building the PCB version, be sure to use the files in this section, and not the breadboard version files.

 
PCB Version: Files

  • schematic and board layout – Board definition in KiCad format
  • Gerber files – For getting a copy of the PCB made at a fab like Seeed Studio
  • CPLD source – Xilinx ISE project and Verilog source code for the CPLD
  • 68katy.xsvf – JTAG configuration file for the CPLD
  • monitor.asm – My ROM-based monitor/bootloader program. I used Easy 68K to assemble it.
  • monitor-plus-linux-pcb.bin – This is the final binary image I programmed into the ROM, containing the monitor/bootloader program with the uClinux kernel concatenated to it beginning at address $003000
  • virtualboxes.org Ubuntu machine – For Linux cross-development, I used Ubuntu 12.04 32-bit running as a virtual machine under Virtual Box. Don’t use the 64-bit version, or the 68K toolchain won’t work. You can use this pre-configured Ubuntu Virtual Box machine image. Username “ubuntu”, password “reverse”
  • uClinux-dist-20040218 – I started from the February 18, 2004 release of uClinux. This is the unmodified version.
    uClinux-20040218-pcb.tar.gz – This is my modified version of uClinux. It includes code for kernels 2.0, 2.4, and 2.6, but I only ported kernel 2.0 for 68 Katy. Search the code for “68KATY” to find my changes.
  • m68k-elf-tools-20030314 – You’ll need a 68K cross compiler and other tools in order to build the uClinux source code. I used m68k toolchain 20030314. It’s supposed to be a self-extracting shell script, but that didn’t work for me. I had to extract it manually, like this:
user@ubuntu$ tail -n +43 m68k-elf-tools-20030314.sh | gunzip > tools.tar
user@ubuntu$ tar xvf tools.tar

 
PCB Version: Parts List

 
Breadboard Version

Want to build a 68 Katy on a breadboard, for the ultimate in geeky fun? This version uses discrete 7400-series chips for most of the address decoding and other glue logic, with the exception of one PAL. The PAL replaces some logic that would otherwise have required more NAND’s, OR’s, flip-flops, etc. If you’re building your own version of 68 Katy, you don’t necessarily need the PAL – just replace it with the equivalent 7400-series basic logic gates.

You’ll need an EPROM burner to program the initial flash ROM data, as well as to program the PAL if you’re using one. Beyond that, no special hardware or skills are required.

Note that the PCB and Breadboard versions of 68 Katy are not binary compatible, due to a small difference in their memory maps. If you’re building the breadboard version, be sure to use the files in this section, and not the PCB version files.

 
Breadboard Version: Files

  • monitor.asm – My ROM-based monitor/bootloader program. I used Easy 68K to assemble it.
  • ehBASIC.zip – A slightly modified version of Lee Davison’s ehBASIC for 68000.
  • monitor-plus-linux.bin – This is the final binary image I programmed into the ROM, containing the monitor/bootloader program with the uClinux kernel concatenated to it beginning at address $003000
  • virtualboxes.org Ubuntu machine – For Linux cross-development, I used Ubuntu 12.04 32-bit running as a virtual machine under Virtual Box. Don’t use the 64-bit version, or the 68K toolchain won’t work. You can use this pre-configured Ubuntu Virtual Box machine image. Username “ubuntu”, password “reverse”
  • uClinux-dist-20040218 – I started from the February 18, 2004 release of uClinux. This is the unmodified version.
    uClinux-20040218.tar.gz – This is my modified version of uClinux. It includes code for kernels 2.0, 2.4, and 2.6, but I only ported kernel 2.0 for 68 Katy. Search the code for “68KATY” to find my changes.
  • m68k-elf-tools-20030314 – You’ll need a 68K cross compiler and other tools in order to build the uClinux source code. I used m68k toolchain 20030314. It’s supposed to be a self-extracting shell script, but that didn’t work for me. I had to extract it manually, like this:
user@ubuntu$ tail -n +43 m68k-elf-tools-20030314.sh | gunzip > tools.tar
user@ubuntu$ tar xvf tools.tar

 
Breadboard Version: Parts List

 
CPU

68katy-schematic-cpu

 
RAM and ROM

68katy-schematic-memory

 
Control Logic

68katy-schematic-control

 
555 Timer for Scheduler

68katy-schematic-555

 
USB Serial FIFO

68katy-schematic-ft245serial

 
LED Display

68katy-schematic-LEDs

27 comments 

27 Comments so far

  1. Charles November 28th, 2014 6:16 pm

    Gosh i hate to be a pain in the butt, but a pcb of this would be kinda sweet…
    just saying 🙂

  2. Karim Yaghmour November 29th, 2014 12:48 pm

    AMAZING!!! Thank you so much for doing this.

    Karim

  3. Lubomir Rintel December 27th, 2014 12:01 am

    Thank you very much!

  4. matze June 25th, 2015 10:01 am

    What about running Minix 68k on this Thing ?
    it would be less Memory demanding and much faster 🙂

  5. Vincent October 6th, 2015 3:59 pm

    I wonder if using an 68SEC000 and MCP you could fit it on a 1″ by 1″ PCB…
    https://hackaday.com/2015/10/02/the-square-inch-project-challenges-your-layout-skills/

  6. Steve Chamberlin October 6th, 2015 4:17 pm

    What’s MCP? Looks like the smallest 68SEC000 package is about 0.4 inches square (10 mm), then you’d still need to fit a CPLD, an SRAM, a ROM, a clock oscillator, the USB serial port chip, power header, button, and a bunch of misc passive components. That would be a heck of a layout job, assuming the parts even fit the PCB in the first place!

    The smallest ever PCB I’ve designed is the Backwoods Logger – mini version, which is just over 2 square inches. http://www.bigmessowires.com/backcountry-logger/

  7. Vincent October 6th, 2015 6:14 pm

    MCP is combined flash and SRAM in a single package
    http://www.datasheetarchive.com/dl/Datasheets-IS76/DSAH00322896.pdf – 48 pin
    http://www.dataman.com/media/datasheet/Renesas/M6MGB_T641S8TP.pdf – 52 pin, more memory

    One would have to cheat a little by putting solder pads on the board edge, like the Bluetooth modules, for CPLD JTAG, USB connector, reset button, power etc

    But you are right – not an easy job, regardless. Thanks for doing this in the first place.

  8. Steve Chamberlin October 6th, 2015 7:13 pm

    Well, now you’ve got me thinking about it… 🙂

  9. Steve Chamberlin October 9th, 2015 11:35 am

    I really like the idea of the square inch project challenge, so I spent some time looking into just how small I could squeeze the 68Katy design, using all SMD parts in the smallest practical packages. 1 square inch is about 645 mm2 or 1290 mm2 if we use both sides of the board, and I estimated the footprints of the required chips would be ~1000 mm2. That wouldn’t leave enough room for mounting all the passive components, let alone routing the traces, so I don’t think it’s possible. But I do like the idea of a tiny 68Katy, and I think a 2 or 3 square inch board could work. Maybe power it direct from USB, and use some kind of JTAG indirect method to program the bootloader… except the 68SEC000 doesn’t even have JTAG.

  10. Vincent October 9th, 2015 12:14 pm

    Yes, I came to the same conclusion. The original thought was that 8 bit mode and 4 layer PCB would free up sufficient board space to route, with CPLD + passives on one side and CPU & MCP on the other – tho it still might be possible with 6 layer. Programming the bootloader would probably involve temporarily soldering to an adapter, burning and uncomfortably removing and resoldering to the tiny target PCB. A stopgap might be to have the bootloader in a separate DIP 24 pin 3V flash with components underneath the socket, but this 3V 24 pin Flash doesnt exist…

    The MC68332 is the next logical conclusion as that has 3 wire Background Debug Mode, like a JTAG predecessor, but is bigger, is drifting further away from the spirit of an early 1980’s 68k board running Linux.

  11. Thanasis November 2nd, 2015 4:33 am

    Hello,
    This is the best project for Linux and Electronics.
    Is it possible to provide a full schematic even if it is hand written with all components?I really want to build the breadboard version.

    Thank you in advance
    Thanasis

  12. Steve Chamberlin November 2nd, 2015 7:57 am

    The (hand drawn) schematics for the 68 Katy breadboard version are here on this page – just scroll up a little. 🙂

  13. Thanasis November 3rd, 2015 2:24 am

    I saw that but it is a bit confusing I would like a drawing all in one. If it is too much trouble I will try to use the separate ones.
    Thank you again for posting this.

  14. Tony November 17th, 2015 7:08 pm

    I have built a board and tested it, it woks fine.
    Have you looked at adding any expansion devices like a lcd display.

    Any ideas on adding a chip select that I could use fo connecting a lcd display.

    Thanks Tony

  15. Steve Chamberlin November 18th, 2015 7:09 am

    To add more peripherals like an LCD display, you’d have have to modify the address decoding to map them into the address space somewhere. A simple but cheesy method would be to re-use the status LED as a chip select for your LCD.

  16. Kiaas January 13th, 2016 6:12 pm

    have you thought about maybe using an MRAM instead of SRAM? it’s not through-hole but it’s as fast as SRAM (with the same interface) and non-volatile like flash. I’ve hand soldered one before on a as-of-yet incomplete project.

  17. Kiaas January 14th, 2016 7:36 am

    Oh I should mention the point of asking, the 1 square inch thing, mram would allow you to replace the flash and sram with just 1 mram. That’s why we’re using it in our project (plus a few transistors to protect a portion of it from being written to protect the firmware, you might be able to stick such functionality on your cpld.)

  18. Steve Chamberlin January 14th, 2016 7:58 am

    See the suggestion above from Victor, posted October 6. It sounds like the same thing?

  19. Tom January 15th, 2016 5:47 am

    Thanks for this – I wonder where computing would be if IBM had taken the 68008 instead of the 8008 to make the PC!

  20. ramin assadollahi November 7th, 2016 12:01 am

    thanks for this really inspiring project! i will try to rebuild your design and document it a bit broader for people like me who are not as deep in electronics as you are. i noticed the GAL chip, which i don’t understand at all, what it is for and what i should do with these equations. i know i need a eeprom programmer for the flash, can i use the same for the GAL? thinking of buying this one: https://www.amazon.de/dp/B00NGFIGOS/ref=wl_it_dp_o_pC_S_ttl?_encoding=UTF8&colid=TTDG7TOKT25L&coliid=IG7GOXHJNFAT3 hefty price, imho, so i just want to be sure i’ll be able to flash the ROm and write the GAL with it. alternatively: can i build the computer without the GAL and only discrete chips?

  21. Steve November 7th, 2016 7:18 am

    A GAL is a rewritable PAL, and is like a simpler version of a CPLD or FPGA. Some EEPROM programmers can also handle GALs, but not all. See this article for some basic information: http://www.uchobby.com/index.php/2008/03/30/gals-for-electronics-hobby/ Alternatively you could use a few discrete NAND and NOR gates to implement the GAL equations. The equations are in EQN format suitable for a tool called Opal Jr. Equations using an = sign are simple combinatorial logic. The equations using a := sign are registered logic and use a DQ flip-flop. * means AND, + means OR, / means NOT.

  22. Matthew Bettcher February 10th, 2017 5:37 pm

    I’ve been working on my own 68k computer and I’m trying to assemble your monitor.asm, but it includes “dis.asm” and that file isn’t included on your site. I found it here http://www.kswichit.com/68k/68k.html but it’s not using some of the same variables and constants your using. Any help is appreciated.

  23. Steve February 12th, 2017 2:36 pm
  24. Matthew Bettcher February 13th, 2017 6:55 pm

    Yes, thank you!

  25. Matthew Bettcher March 30th, 2017 2:28 pm

    What is the purpose of the pull-up resistors on the data bus? I\’ve working on my own 68k design for some time now and have never seen that on any other design that I can remember. Is it to ensure a correct value on the data bus during an interrupt? As per the datasheet external devices supply vector # on data bus during interrupts, but the only device that fires interrupts (CPLD) isn\’t fully connected to the data bus, so you tie it high?

  26. Steve March 30th, 2017 2:51 pm

    Hmm, that’s a good question. There are no data bus pull-ups in the hand drawn schematic, and I don’t remember why I added them when I redid it in KiCad. I think I was worried about the bus being left to float in an undefined state, and that that might cause problems for other components. I believe the CPLD can act weird if its inputs aren’t well-defined 0’s or 1’s, if I recall correctly.

  27. Matthew Bettcher March 30th, 2017 3:02 pm

    Interesting, so only D0 would need to be pulled up as it’s the only one going into the CPLD.

Leave a reply. Comments may not be monitored regularly. For product support questions, visit the Contact page.