• Stars
    star
    245
  • Rank 165,304 (Top 4 %)
  • Language
    Assembly
  • License
    BSD 3-Clause "New...
  • Created over 4 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Minimal 68000-based single board computer

68k nano

A minimal single-board computer based on the venerable "Texas Cockroach" Motorola 68000 16/32-bit microprocessor.

Board image

Features

  • 68HC000 processor running at 12MHz
  • 1MB RAM
  • 64KB ROM
  • 16550 UART providing a 5V FTDI serial port
  • 44-pin IDE connector for CompactFlash card adapter
  • Connector for SparkFun DS3234 real-time clock
  • Only two 74HC glue logic chips required

This might be capable of running uClinux, but I haven't tried it!

Hardware

The 68k nano hardware is simple and straightforward. It can be built on a breadboard (though there may be stability issues at higher clock speeds).

Memory map

Due to the minimal address decoding circuitry, accessing certain memory regions will cause multiple devices to be selected. This should be avoided.

$000000-0xFFFF     ROM (repeats 16 times)
$100000-1FFFFF  X  Forbidden (multiple devices selected)
$200000-2FFFFF     ROM (mirror of $000000-0FFFFF)
$300000-$7FFFF  X  Forbidden (multiple devices selected)
$800000-8FFFFF     Open bus (available for expansion)
$900000-9xxxxF     CompactFlash card
$A00000-AxxxxF     UART
$B00000-BFFFFF  X  Forbidden (multiple devices selected)
$C00000-CFFFFF     RAM
$D00000-DFFFFF  X  Forbidden (multiple devices selected)
$E00000-EFFFFF     RAM (mirror of $C00000-CFFFFF)
$F00000-FFFFFF  X  Forbidden (multiple devices selected)

This is summarized with the following equations:

/ROMSEL  = /A23
/RAMSEL  =  A22
/UARTSEL =  A23 * /A22 * A21
/CARDSEL =  A20

I/O

The 16550's modem control lines are used as a bit-banged SPI interface. A 7-pin header is provided for SparkFun's "DeadOn" DS3234 real-time clock board. Access to SPI is therefore achieved via the 16550's Modem Control Register and Line Status Register.

A 2mm pitch 44-pin IDE connector is provided for storage devices. This is intended for CompactFlash card adapters (operating in 16-bit True IDE mode) but may also work with parallel ATA hard disks. (not tested)

Interrupts

All interrupt sources are routed through the 16550. All 16550 interrupts invoke the level 1 autovector (vector offset $064) and it is up to the software to determine the source of the interrupt.

Building it

bom.txt contains a bill of materials. As of this writing (July 2020), all components are available from major distributors like Mouser and Jameco. If purchasing 68000s from eBay, note that vintage ICs are a common target of counterfeiters. For this project I used Toshiba TMP68HC000P-12 chips from Jameco and they work just fine.

All parts are through-hole for that extra vintage feel. Note that some of the decoupling capacitors (C4, C5, C6, C8, and C10) are underneath ICs, so open-frame IC sockets are required. Large IC sockets can also be expensive (especially DIP-64 sockets!) so a cheaper alternative is to use breakaway SIP 0.1" machine-pin headers.

Due to the spacing of the chips, Textool ZIF sockets won't fit. For the ROMs U5 and U7, Aries 28-526-10 low-profile ZIF sockets will fit, but barely. The release latch may scrape against the RAM IC to its north, but I've found that it's not a huge deal.

You can use either a full-can or half-can oscillator for X1. Note that if using an oscillator with a frequency other than 12 MHz, you'll have to update the F_CPU value in the Makefile. (see below) Also note that, if using a 68HC000, the minimum clock frequency is 4 MHz.

The 44-pin IDE header accepts a CompactFlash adapter board such as this one, available from Amazon and other vendors.

Software

This project uses the vasm assembler and a standard Makefile. Python 3 and PySerial are also required to upload programs to the computer via the serial port. The Makefile also contains rules for burning ROM images to AT28C256 EEPROMs using minipro if you have a TL866II+ programmer. (If you don't have a chip programmer, you should get a TL866II+, they are reasonably priced and available from a number of vendors.)

Building it

Running make rom will build the ROM image and split it into "odd" and "even" halves, rom-l.bin and rom-u.bin. Each file should be 32,768 bytes exactly. Running make burnrom will write these files to a pair of AT28C256 EEPROMs using minipro.

Note: if using an oscillator with a frequency other than 12 MHz, change the value of F_CPU appropriately in the Makefile.

The BAUD variable in the Makefile sets the baud rate of the serial interface. Use the included script baudrate.py to determine which baud rates are usable with a given oscillator frequency.

ROM features

The ROM is fairly minimal--it's closer to a bootloader than an operating system. It supports loading programs from the root directory of a FAT16-formatted CompactFlash card and some basic debugging functionality. It also provides a small set of system calls for I/O to simplify application programs.

The power-up process is as follows:

  • Initialize serial port to 57600 baud, 8 data bits, no parity, 1 stop bit.
  • Test RAM. If a RAM failure occurs, the failed address is written to the serial port and the Status LED flashes rapidly. (This is prone to failure when running on a breadboard at higher clock speeds.)
  • Check for the real-time clock module. If found, print the current date and time to the serial port.
  • Check for a CompactFlash card, and attempt to mount the first partition if it is FAT16-formatted.
  • If the "ENTER" pushbutton is NOT held down:
    • If a valid card is inserted, check for a file in the root directory named STARTUP.BIN. If found, load it into RAM and execute it.
    • If STARTUP.BIN was not loaded, enter an interactive command shell.
  • If the "ENTER" pushbutton is held down, enter the interactive command shell and bypass execution of STARTUP.BIN.

Example startup sequence (without STARTUP.BIN):

68K NANO - ROM VERSION 00009900 (20200708)
(C) 2020 MATT SARNOFF (MSARNOFF.ORG)
TESTING RAM...PASSED

RAM: 1,048,576 BYTES
ROM: 65,536 BYTES
CPU: 12,000,000 HZ
TIME IS 2020-07-07 19:14:36
CARD DETECTED: 250,608 KB 'NO NAME    '
CANNOT LOAD STARTUP.BIN - FILE NOT FOUND

TYPE ? [ENTER] FOR HELP.
>

Command shell

If STARTUP.BIN was not loaded, an interactive command shell is available via the serial port. (57600 baud, 8 data bits, no parity, 1 stop bit). Type ? and press Enter for a list of supported commands. They are summarized briefly here. Note that commands and filenames are case-insensitive.

  • .L - list files in the root directory of the CompactFlash card. Long filenames and hidden files are not displayed.
  • .I - print low-level information about the filesystem on the CompactFlash card.
  • .P file - print the contents of the file named file in the root directory of the CompactFlash card as ASCII text.
  • .H file - print the contenxt of the file named file in the root directory of the CompactFlash card as a hexdump.
  • .T - print the current date and time as reported by the real-time clock module.
  • .T YYYYMMDDWWhhmmss - set the current date and time. The new date/time should be expressed as a string of 16 decimal digits with no separators. WW should be a 2-digit weekday between 01 and 07 inclusive. You can obtain the current date/time in this format with the Unix command date "+%Y%m%d0%u%H%M%S".
  • .D - enter the debugger.
  • file - any other command is interpreted as a filename to be loaded from the root directory of the CompactFlash card and executed. Unlike MS-DOS, the file extension is required. e.g. to execute the file named foo.bin, enter FOO.BIN. (FOO will attempt to load a file named foo with no extension).

Serial loader

A break condition on the serial input line enters the serial loader, allowing programs to be uploaded to RAM from a host computer. The Python script serload.py and the Makefile rules make load and make run take care of this.

Debugging

A hardware exception causes a transfer into a basic debugger. The Status LED flashes rapidly and a register dump is printed to the serial port:

*ILLEGAL INSTRUCTION
D0=00000064  D1=0000000A  D2=00000038  D3=00000009
D4=00000000  D5=00000000  D6=00000000  D7=00000000
A0=00E0003C  A1=00001D40  A2=00000000  A3=00F00000
A4=00000000  A5=00000000  A6=000001E2  A7=00EFFFFA
SR=-S0--Z--  PC=00001D3A              USP=7F7EFFDF

[A]BORT/[C]ONTINUE/[S]TEP?

Supported commands are:

  • a - abort execution and return to system.
  • c - (attempt to) continue execution. (the Trace bit is cleared)
  • s - set the Trace bit and single-step.

TRAP #15 is treated as a breakpoint instruction that also enters the debugger.

API

See API.md for a detailed description of the system calls provided by the ROM API and guidelines for application programs.

Known issues and shortcomings

  • ROM is always present at the bottom of the address space, so the exception vectors cannot be overridden by application code.
  • Interrupt handling is a hack, since all interrupt sources go through the 16550.
  • Address decoding leaves little room for expansion.
  • System calls should set the condition codes to simplify application code.

Future directions

This is a small-scale project. I'm thinking about desiging a larger 68000 board in the future, so I probably won't continue working on this one. Here are some project ideas that I won't have time to tackle, but you're welcome to:

  • Running an existing 68k monitor like TUTOR or zBug.
  • Running a language like EhBASIC or a Forth.
  • Adding FAT16 write support.
  • Booting uClinux like Steve Chamberlin did with 68 Katy.
  • Using the DS3234 real-time clock's SQW output to generate a periodic interrupt. (likely necessary for uClinux)

About

Open hardware, released under the terms of the 3-clause BSD license.

Copyright 2020 Matt Sarnoff.

http://twitter.com/txsector

http://msarnoff.org

More Repositories

1

Amethyst

8-bit ATmega1284 retro computer
Assembly
272
star
2

Ultim809

Schematics, design files, and software for my Ultim809 homebrew 8-bit computer.
Assembly
57
star
3

LPC1114-Synthesizer

Synthesizer based on the LPC1114 ARM micro controller
C
57
star
4

7400-Drum-Machine

A percussion synthesizer/sequencer built entirely out of discrete logic: no microcontrollers or software.
50
star
5

PIC16F1-USB-Bootloader

A tiny USB CDC bootloader for PIC16F1454/5/9 microcontrollers
Assembly
47
star
6

chipdb

Open source integrated circuit quick reference database
30
star
7

1-Bit-AVR-Synthesizer

Firmware and schematic for an ATmega48-based pulse wave synthesizer.
C
26
star
8

Terminalscope

Firmware for a VT100-compatible serial terminal that draws on an oscilloscope or XY monitor.
C
20
star
9

8088sbc

Minimal 8088 single board computer
Assembly
15
star
10

Currentsong

Displays the currently playing iTunes track in the Mac OS X menu bar.
Objective-C
13
star
11

Panaplex-Clock

Code/schematics for a clock using a Panaplex (planar gas discharge) display
C
9
star
12

SwiftSound

Experiements with simple sound synthesis in Swift
Swift
6
star
13

PIC-OSX-Example

Example project for programming a PIC microcontroller on Mac OS X using SDCC
C++
5
star
14

teensy3-without-arduino

An absolute bare minimum project template for Teensy 3.x boards
C++
5
star
15

ROMBurner

An Arduino sketch to program AT28C64B EEPROM chips
Java
5
star
16

dcpu16-vim-syntax

Vim syntax highlighting definition for Notch's DCPU-16 assembly language
Vim Script
4
star
17

atmega4809-stub

Sample project for "0-series" megaAVR microcontrollers
Makefile
4
star
18

kicad-intelligent-displays

KiCad symbols and footprints for HP/Litronix/Siemens/Osram/Avago/Broadcom intelligent alphanumeric LED displays
C
4
star
19

TinySimon

"Simon" game based on a PIC10F200 microcontroller
KiCad Layout
4
star
20

LPC54114-Stub

Minimal example project for the LPC54114 dual-core microcontroller
C
3
star
21

Arduino-For-Kids

A proposal for a more kid-friendly Arduino IDE based on the Logo language
3
star
22

millitext

Generate really tiny text
Ruby
3
star
23

Starburst-One

Single-chip alphanumeric display driver
KiCad Layout
3
star
24

Numitron-Clock

An alarm clock using 9-segment numitron displays
C
3
star
25

bigtext

Generates big pixelated text using the Unicode Braille Patterns
Python
2
star
26

ultim809-mess

Ultim809 support for the MESS emulator
C
2
star
27

remona

A symbolic remote monitor/debugger for 8-bit computers
2
star
28

USBModelF

Teensy 3.2 USB converter for IBM Model F (XT) keyboards
C++
2
star
29

Lazymote

A TV control panel I stuck on my coffee table
C
1
star
30

footprint

Python library for creating gEDA pcb footprints
Python
1
star