rosco_m68k: August Update

Time for another update on the rosco_m68k, my homebrew retro computer project. As always, regular updates can be found on hackaday, so please do check there for the details (and like/follow if you want to!) – this will be more of a digest of what’s been going on over the past couple months.

The Headline

So I guess the headline thing that’s been happening recently is that I’ve started working toward having a PCB manufactured for this thing. I realised I needed to press on with this after I took the breadboard in to work for a geek-out session with some of my awesome colleagues, and had a totally nerve-wracking commute with the breadboard (it survived, save for one current-limiting resistor which developed a loose connection).

So I started work on reducing the component count (more on that later) and actually designing a PCB. It’s now pretty-much ready to go off to OSHPark for manufacture (Yes, I could get it cheaper but I like purple and, y’know, yield) and looks like this:

(The real one will be purple…)

So that’s the hot-of-the-press headline (I finished it today), and I’ll update more once the boards are made. In the meantime, if you want more details, follow the project on Hackaday for (usually) weekly updates.

Lowering the component count?

In the original design of this computer, I went for a full 7400-series TTL design for all of the glue logic, and that was cool. I learnt a lot about designing with discreet logic gates, was forced to really think about the way I wanted my circuit to work, came to understand propagation delay in a way I didn’t before, and bought a lot more breadboard. That last point is important – fifteen 7400-series chips, while cool, take up a lot of physical space. And PCB fabs charge by the square inch.

It had been pointed out to me before (thanks, Ken!) that I could do with a couple of programmable logic devices what I was previously doing with ~fifteen discreet logic ICs, so I decided (in the interests of staying sane and solvent) to investigate. After a good bit of reading and learning, I’ve now replaced most of the 7400-series on the board with two ATF16V8QL (link to PDF) CPLDs.

This is a win in more than one respect – not only has it saved me board space but it’s made routing the PCB much easier, cut down the current draw of the board, fixed up some propagation delay issues and allowed me to (finally) fix the bug with the expansion select line. These chips were available at the time the CPU I’m using was released, are still in production today, and cost me around £1 each (delivered, based on 5-off, from Farnell in the UK). They’ve taken over all address decoding and IO glue logic, and I highly recommend them.

What About Software?

Things haven’t stood still on the software front – since my last blog I’ve fully integrated the MC68901, gotten timers and interrupts working, and made the UART work such that the computer can now talk over serial (via a CP2102 Serial-to-USB converter I had lying around). Work on an OS for this thing continues apace, and it already has some basic memory management, a fully async serial driver, and has been demonstrated with some (very) basic multitasking. My immediate plan is to implement a way to load software via serial (Zmodem) in the immediate term to make it so that, as I continue to develop the kernel, I don’t have to physically pull the ROMs to reprogram them.

It’s Going Well, Then?

I like to think it is, yeah. I’m having tons of fun, and this thing is starting to look like a product. Once the PCBs are made and I’ve done some more on the software, I think this thing will be at a point where other people might want one. Obviously it’s a 16/32-bit computer in a 64-bit era, but I kinda feel like it might make a great starting point for people wanting to really get to grips with bare-metal, without all the lies abstractions that modern architectures force on them.

The PCB design gets me to a point where the core computer is done, and the expansion connector I put in means I can continue to develop new bits without worrying about disturbing the ever-so-fragile connections on the existing breadboard. This will mean graphics, networking, and who knows what else.

And even if it never goes anywhere beyond the three prototypes I’m going to be building soon, I’ve learnt a hell of a lot from this project, and continue to do so every time I work on it – and that’s really all that matters, right?

As always, the rosco_m68k is open hardware/open source. The complete set of design, documentation and code can be found on Githib at https://github.com/roscopeco/rosco_m68k.

Retro Computer Update

I’m writing regular logs on hackaday.io about the m68k-based retro computer I mentioned I was building a while back, but I thought I’d post a quick update here too. If you’re interested in the project, be sure to follow it on hackaday as that’s where the regular updates are going.

The main progress so far has been:

  • Get the CPU free-running
  • Decide on a memory layout, and design an address decoder to support that layout
  • Build the address decoder
  • Decide how I want to lay the buses out on the board for easier interconnection
  • Actually wire up the buses accordingly

I actually designed the address decoder a while ago, but gathering the parts and then wiring it up has taken some time – I finished it yesterday. Since then, I’ve been breaking out the CPU signals onto control, data and address buses, which I’m doing on an otherwise-bare breadboard in the middle of the main boards.

Right now, the rosco_m68k looks like this:

It’s still free-running at the moment (I’ve not wired the memory to the bus yet as you can see) but all the control pins I care about (basically everything except the legacy 6800 peripheral pins and the function code) are now on the control bus. The jumpers you can see there are configuring those control pins for free-run mode and will be replaced by connections to the RAM and ROM.

I did come across a couple of design errors while building the address decoder, some of which I fixed and others I’ve decided I can live with for now (e.g. an issue with the expansion select line I only discovered once I’d completely built the decoder and hooked up the LEDs at bottom left).

Anyway, that’s where it’s at right now. I expect that after another day’s wiring, it’ll be ready to run real code, and I can’t wait.

I’m building a retro computer!

Somewhere around the time I got bored with Advent of Code 2018 (well, the challenges grew to become total time-sinks), I decided my project for the new year was going to be a homebrew retro computer.

I decided that, rather than something 8-bit based on the Z80 or 6502, I wanted to go up a generation and build something 16-bit. 

Apart from gaming and a bit of BASIC programming on 8-bit machines like the Spectrum and C64, my first “real” computing was done on the Amiga, a machine which still has a special place in my heart today. For that reason, I decided I wanted to build something based on the Motorola 68000 series processor. 

I chose the 68010 which (as far as I’m aware) was never used in the Amiga line, but which is slightly more capable than the 68000 (e.g. interrupt vectors can be moved around and it can support virtual memory when used with a 68451 MMU, though I’m not likely to do the latter in this build). Mine is rated for 10MHz, but I’m only running it at 4MHz at the moment).

The key differences between this and an 8-bit Z80 or 6502 build are:

  • Dynamic registers, so the clock cannot be stopped or single-stepped (this can be emulated by manipulating /DTACK though).
  • Asynchronous data bus and DMA support, with /BGR, /BGA, /BERR and /DTACK to take care of.
  • 16-bit data bus, so more wires needed.
  • 24-bit (with some caveats) address bus, so lots more wires needed, but 16MB of address space available!
  • Internally, the m68k family is 32-bit.
  • /UDS and /LDS lines for selecting upper and lower data bytes, so a more complicated address decoder and ROM/RAM in pairs.
  • No separate IO space, further complicating the address decoder.
  • More complicated requirements around /RESET and /HALT handling, especially at power-on.

I started gathering parts in January, and so far have the crystal clock circuit, the reset/halt circuit, and have gotten the CPU freerunning with /DTACK grounded and the various other bus management lines tied high or low as appropriate.

The address decoder is designed, and I already have the RAM and ROM chips ready to go. I’ve also built an EEPROM programmer because I’m too impatient/cheap to order one and wait for it to arrive.

All this means that, pretty soon, I should be able to get it running some actual code!

Fun times are ahead! If you’re interested, you can follow the project over on Hackaday.

It’s Alive!!!!!