Blitz 68030

Feature highlights

  • Motorola 68030 @25-50MHz + 68882 FPU
  • 4MB of static RAM + 64MB DRAM
  • 512k of Flash ROM
  • VT8242 based PS/2 Keyboard interface
  • AIC37C65CL based Floppy interface
  • ATA hard disk interface
  • 3x 8-bit ISA expansion slots
  • MicroATX form factor & PSU connector
  • Glue logic handled by a single XC9572XL CPLD

Hardware

I went for a relatively large amount of SRAM onboard since i knew getting the DRAM working was going to take a while. The SRAM is mapped starting at the base of memory extending upwards to 0x400000, and the DRAM is mapped in a nonconsecutive bank starting at 0xC000000. Once the DRAM is working, I’ll likely move the malloc heap into there to take advantage of all the extra memory. Since that frees up a lot of the SRAM, I might be worth copying the OS there on boot to take advantage of the single bus cycle memory access; much faster compared to the flash.

The large chip next to it is a PIC24FJ256, which has hardware LCD controller that i planned to hijack. I never got around to implementing it, since I had started an FPGA based solution around the same time. It was removed from the latest revision board, since I had success with using a CGA card for video instead. There is no serial port onboard, since it was much easier to just add a PC serial card to on of the ISA slots.

Software

Blitz runs my 32-bit operating system G-DOS. It supports FAT filesystems, and uses a flexible driver & init subsystem that handles hardware interfacing. G-DOS has my custom shell (G-Shell) and monitor (G-Mon) built-in, and boots directly from the onboard Flash ROM. A CGA card can be installed in an ISA slot to provide video output, and is required to use Blitz effectively. Lastly, it includes a boot-loader that can load & bootstrap a Linux kernel off a disk.

A quick history of Blitz

Wire-Wrapped Prototype

Blitz started as a wire-wrap prototype. It had the 68030 hooked up to 2MB of RAM and ROM with GALs for logic, plus an LED register as its only output. Once I had proof of code execution by seeing it blink the LEDs, I realized that wire-wrapping two 32-bit buses around was a pain in the ass, and went to design a PCB. Around this time, I started development of G-DOS, which I would develop concurrently with the hardware.

PCB Revisions

I then went through 3 PCB stages; The first board was just the CPU+FPU, RAM, and ROM. The second stage added on the ISA slots and the CPLD-based DRAM interface. The third stage changed the DRAM design, then added on-board IDE, Floppy, and PS/2 interfaces. This revision was compatible with the MicroATX form-factor so it could be installed in a PC case, and this ended up being the last revision. Each of these stages got produced, assembled, debugged, and tested over about 2 years.

Bring-up

While bringing up the PCB version of blitz, I struggled a lot with the CPU randomly freezing. This problem would go away if I just held my finger on the metal lid of the CPU. I assumed it was a power supply problem, maybe lacking the current supply for the CPU or something. I kept spamming more and more capacitors on later board revisions and the problem subsided, though never fully went away.

For a long time, there was a nasty issue with my CPLD code; The data bus byte selects were being driven completely backwards! Despite this, it still managed to boot G’Mon all the way to the prompt before I realized anything was wrong. It took until I created an emulator front-end for Blitz’s hardware for me to finally figure it out.

Videos

Reflections

Blitz has been a 3 year long journey that took me from doing simple 8-bit brews all the way to designing complex 32-bit systems. I’ve learned an incredible amount about the complexities of 32-bit bus design and system logic in general. Thousands of hours were put into this thing, going through countless revisions, and a lot of trial and error.

Although I have moved focus to other projects, there are still some parts left incomplete. Some of the stuff hasn’t been implemented fully, like the DRAM interface, and imperfections still exist. But it has reached a point where i am content with what I’ve accomplished, so I am releasing all my design files and sources here. I plan on resuming development of Blitz shortly, now that I have a break from school.


Are you selling kits/can I make my own Blitz?

I have no plan on selling any sort of kit for Blitz. It was made as a passion project, and I have no financial interests with it. There are still parts that don’t fully work, like the DRAM, so I recommend that you don’t try and assemble one yourself, at least for now. Since I am continuing to develop Blitz, if you want to build one, try waiting until I release a final revision board and software. However, if you still decide to make one, I am happy to answer any questions you have. Shoot me an email (notartyomowo@gmail.com) and I’ll do my best to respond.


Blitz is licensed under the GNU General Public License v2. Although I don’t expect contributions I’d appreciate if you shared any improvements with me, by either doing a pull request, or notifying me through email. Thanks!

6502 Watch

Introduction

The 6502 has been around for just about 40 years, yet still powers the hearts of many electrical systems in place today, such as many micro-controllers and embedded systems. In fact, WDC still manufactures the 6502 and 65xx series chips under the 65c02 and 65cxx. I’ve noticed that WDC also introduced more package variants of the 6502 and 6522, such as PLCC and QFP. Another thing I noticed was the fact that these form factors of the 65c02 are almost never used. Given that the only people buying these are hobbyists, that isn’t too surprising, as they don’t offer much over the standard 40 pin DIP. What they do offer, however, is small package size. I went off to try and design the smallest 6502 SBC i could, and was pleasantly surprised with the results. What I ended up with was what i think is the smallest hobbyist 6502 SBC produced. Small enough, in fact, that you could easily wear it on your wrist! I then added the neat little Nokia 5110 LCD and a cool interface, and now have what I believe to be the only 6502-driven watch in existence.

Hardware

The watch is pretty standard as far as 6502 hardware goes:

  • 65c02 running @ 8MHz
  • 65c22 VIA (controls LCD, keyboard, and buttons)
  • Nokia 5110 LCD (84×48, bitmap only)
  • 32k SRAM
  • 16k ROM
  • C64 Keyboard Connector
The front face of the PCB. The connector along the top fits a CBM-style keyboard from a VIC-20 or C64.

Probably the strangest bit there is the full size C64 keyboard connector along the top of the watch. I wanted to have some sort of physical interface for grabbing character data, since the point of the watch would be mostly ruined by it needing to be tethered to a serial port at all times. The simplest way to do this is to use some preexisting matrix keyboard and wire it to a parallel port, which is what I ended up doing.

The back face of the PCB. In the top left is the circuitry for charging the optional Li-Po battery (which on this board is absent). Bottom right is the RTC and watch crystal that provide the clock functionality to the watch.

The part that ties everything together is really the tiny Nokia LCD. It’s interfaced through SPI, which i had to bit-bang through the 6522 VIA. The VIA also interfaces with the keyboard, and the face buttons. An interesting thing to note here is that the VIA only has 16 i/o pins, which in this case are all needed to interface just with the keyboard alone. I was able to use some of those pins for both the keyboard and the LCD without causing any sort of corruption with a bit of luck, and a lot more trial and error.

The fully assembled watch running Tetris.

Software

The watch has a few different things on its ROM. The primary thing is G’Mon, a machine monitor i wrote for the 6502. It  supports viewing memory in single and batch, depositing memory in single or batch, jumping to programs, filling blocks of memory with a pattern byte, and moving blocks of memory. I had to strip a few of the less useful commands out in order to fit it on the ROM with everything else. The secondary thing on there is Lee Davidson’s Enhanced Basic. I was just barely able to fit into the ROM with everything else, like there are only around 100 bytes free. EhBasic has been modified to hook into the watch’s main code, but other than that it’s a completely normal version of EhBasic!

The thing that greets you when you start up the watch is the watch interface. Clever name, i know. It just provides a graphical menu you can move through to select what you want to run. This is the only place where the face buttons are actually used, at least on purpose. The topmost button is what brings up the menu. Interesting bit about that: its connected directly to the NMI pin on the 6502, so it can be used to get back to the watch menu from almost anywhere on the thing (unless you crash the 6502).

In my sources, there is a big blob of code that handles interfacing with the watch hardware; It’s called the kernel there, but its less of a kernel and more of a library everything else references. Some of the more interesting things in there are the SPI bit-banging stuff for the LCD, and the matrix scanning and decoding routine for the keyboard.

Speaking of sources, they are all uploaded on here, of course. All the assembler code is written to be assembled using KickAssembler, and makes quite heavy use of its macro capabilities, so i doubt it would be fun to try and assemble with anything else. Here i have also included the EhBasic sources that i have modified; They have been modified to be assembled with KickAssembler. Everything builds at the same time, just run the ./Compile.sh script and it will spit out a ROM image. If for some reason you feel the need to fiddle with it, then make sure to go to Configuration.asm: That’s the header that holds a bunch of the miscellaneous variables, like the location of the ROM in memory.

If you every wanted to run the software yourself, then you can do that as well. If you set the Emulated variable in the config file to true, then it will build a ROM for use with Symon.

Other Software Toys

I have written a few extra programs to show what the hardware itself can do. The first thing is a little sprite demo that has 8 animated software sprites bouncing around the screen, plus a text scroller along the top. The visibility is quite poor with it, as the LCD sure does take its time with updating the pixels, which causes everything moving to be a little blurry. To combat this I had to wait a bit after each frame for the LCD to update, which means that the demo itself runs a little slower than it actually could on the hardware. A video of this demo in action is in the Demos section.

Did i mention it runs Tetris? Because yea, it sure does. I wrote a version of Tetris for the watch not long after realizing it was probably the only practical thing that it could feasibly do. Its a pretty standard Tetris clone, following pretty much all of the mechanics of the original versions. This means having the scoring system, having the progressive levels, all the tetrominoes, etc. Its controlled using the face buttons, using the navigation buttons as left & right, the center button as rotate, and the NMI button as the drop button. At the moment I don’t have actual recordings of Tetris running on the watch, mostly because i am too lazy to do that much work for a project that was finished nearly 2 and a half years as of this write-up, but i do have the graphics assets i made for it, and have put them together into what it looks like while. If you don’t believe that I wrote Tetris for it, then don’t worry, just take a look at the sources that i have included with the project’s main downloads.

Some Demos

This is a little demo i made to test the graphical capabilities of the watch. It implements 8 fully animated moveable sprites bouncing around a play-field with a scrollertext running across the top.
This clip shows the main watch OS. The watch menu is accessible at any time (via NMI) by hitting the menu button on the left hand side of the watch. From there you can drop into your choice of either Enhanced BASIC or G’Mon.

Schematics

Schematics and boards were laid out using KiCad. The watch board is 3×1.5 inches in size and double sided. The board uses all SMD parts except for the PLCC socket, keyboard connector, and LCD connector.

The Rest

This project is quite old now; I finished it late 2017 and am only now getting to documenting it. So it would be no surprise to hear that i have stopped working on it. I don’t plan on supporting any of the hardware here, so if you decide for whatever reason that you want a 6502 watch as well, then you are on your own. If you find any of the software interesting though, then I’m all ears for questions; I haven’t written 6502 assembly in a few years now but still know these sources in and out.

Performing a 1541 Drive Head Transplant

Recently I came across a Newtronics style 1541 drive, and as usual the read/write coil was wide open. I decided it would be interesting to see if i could get it working again with a donor drive head.

The donor head was taken from some 5.25″ Chinon PC compatible drive i had in my dead parts bin. The two heads were physically different enough to make swapping the carrier as a whole unit impossible, so I had to transplant the R/W coil directly into the old frame.

Removing the old coil from the Newtronics head was a real pain because of all the epoxy. I ended up punching/breaking the center out with a rod and using snips to remove the coil’s housing. There was a resistor and a diode soldered to the bottom side of the old head that might have been important, but since they weren’t present on the donor I didn’t move them over. To fix the donor coil in place I wrapped it in enough electrical tape to fit it snugly in the frame, then secured it with super-glue. I wouldn’t recommend this, as super-glue doesn’t hold up well to heat (which is pretty important given how hot 1541s like to get), and it leaves a white residue all around the part. Ideally I would have used a 2-part epoxy, but I got impatient.

My best attempt at aligning the new head.

After a bit of time, I was able to get a good alignment on the drive. I ran some demos and it handled them just fine. Funnily enough, the hardest part of the alignment wasn’t actually the head; it was realizing that the disk was slipping in the spindle.

Off-Market MEGA65 Devkit

The MEGA65 booted
Booting the latest MEGA65 bitstream on the Nexys A7100T FPGA development board.

Recently the MEGA65 project began selling their first batch of official development kits. Naturally, they sold out before I could get my hands on one; luckily for me (and many others), the latest bitstreams are still being built for the off-the-shelf Nexys A7100T/Nexys 4-DDR FPGA development boards!

The FPGA development board itself
The Nexys A7100T development board that I’m using for the core of my MEGA65.

Now, by using an off-the-shelf FPGA development board in place of one of the custom designed MEGA65 r3 devkits, you’re obviously going to be missing a lot of the peripheral features right out of the gate (such as the injection molded keyboard + housing, expansion port, joyports, IEC, second SDcard, etc). However, with a little bit of luck and a lot of fudging, you can find substitute parts for all of these to wire into the IO expansion headers on the Nexys A7:

I’ve already decided on parts for the chassis and keyboard (pictured in the gallery above). I knew I was going to end up using one of my spare Commodore 64C shells for this, and since the MEGA65/C65 uses an extended keyboard layout similar to the PC/AT, i couldn’t just use a standard C64 keyboard assembly. I thought finding a fitting keyboard was going to be tough, but pretty quickly i managed to find a donor Thinkpad matrix that covers the c64c faceplate perfectly!

There’s still a lot that seperates this from a ‘complete’ devkit, but what I have working now is all I really need for a bare-minimum development platform!

Franklin PC-8000

The PC-8000 is part of a line of PC clones sold by Franklin Computer from 1986-1988. It was discontinued as a result of the Apple vs Franklin lawsuit that began in 1982.

Franklin Computer, 1982

The majority of Franklin’s business focused around it’s two Apple II compatibles: the ACE-100 and ACE-1000. These were clones of the Apple II and II+ respectively. Now, it’s a bit unfair to say that these are ‘clone’ computers; They are near exact copies of the Apple II, with even the ROMs being carbon copies of those seen in the originals. Knowing Apple, you would think this was a lawsuit waiting to happen, and it absolutely was.

Apple vs. Franklin

In 1982, Apple filed a lawsuit against Franklin Computer, alleging that Franklin had copied major portions of Apple ROMs for use in their ACE line of systems. Franklin admitted that it had indeed copied their software, but claimed that since the Apple II ROMs only existed in binary form, it was not protected by copyright. The court ruled in favor of Franklin, directing Apple to file an appeal. At the same time, another lawsuit just happened to be concluding: Williams Electronics vs. Artic International. This entirely unrelated suit essentially concluded that binary ROMs and software were indeed protected by copyright. This overturned the previous ruling in the Franklin case, and in extent ruled that operating systems were also protected by copyright.

The suit concluded in 1983, ordering that Franklin must withdraw all of its clones by the end of 1988. This included the use of the IBM PC BIOS.

Enter The Franklin PC

This didn’t stop Franklin from trying to continue with its computer business though. In 1986, just two years before their deadline, they released a new line of PC clones: the PC-5000, PC-6000, and PC-8000. Unlike their previous systems, these were not developed in-house. Franklin licensed out the Multitech Popular 500 , a generic PC clone, and rebranded it under its name.

The models differ by memory size and number of disk drives, but otherwise are all the same. The unit I have is a PC-8000, the most expensive configuration ($949.99 in 1986), sold with:

  • 640KB RAM
  • 8088 CPU @ 4.77MHz
  • Two 360K 5.25″ disk drives
  • Standard CGA graphics output

Card Gallery