65C02 Single Board Computer
Last Update: September 29, 2014
- Features At a Glance
- Block Diagram
- Schematic Diagram
- Memory Map
- XPAN Connector
- Part List
- Firmware & Bootloader
- Appendix A: Complex Programmable Logic Device (CPLD)
- Appendix B: Using a network card to program the flash chip
Note: This project is under development; this document is incomplete at this time and may be inconsistent. This project is actually the result of several ideas that managed to coalesce into a single project. Building a computer around one of the old 'classic' microprocessors (Z80, 6502, 8051, 68k) has been something I wanted to do for a while - call it nostalgia for a simpler time. It was also born out of frustration with 'simple' low cost development systems intended for students and beginner hobbyists, namely the Arduino and Raspberry Pi. These platforms are a good introductions to electronics but the all-in-one nature of the CPUs and the slick software development environments abstracts away almost all the complexities. While there is educational value in these systems, I've discovered that the end users tend to treat them as mysterious black boxes - people tend to rely on blobs of code and libraries that they only understand enough to know that if they feed it data X it will do Y. A chance conversation in a bar convinced me there was a market for a much more open and lower level learning tool. Modern microcontrollers and SoCs are complex devices with equally complex and opaque tool chains. My idea was to break open those chips (not literally) and lay out a simplified version of the internals for a user to poke and prod with multimeters, oscilloscopes and logic analyzers. This board is designed to be as simple as possible: a microprocessor, RAM, non-volatile storage, a serial port, an expansion bus, and some glue logic. All the parts are through-hole and easy to solder. Many of them are in DIP packages so the user can pull them out and use them on a solderless breadboard or their own boards. The parts are also inexpensive and mostly generic - it should be easy to source replacements if there are any 'learning experiences'. I wanted to avoid complex, high level languages (to avoid the learning curves and resulting abstraction) and if possible avoid complier chains and IDEs altogether. The idea was to get people down onto the bare metal, up close and personal with the registers, the address bus, and the program counter. It made sense to use an older microprocessor as these tend to be straightforward in terms of architecture and design. The 6502 is well characterized, there is plenty of documentation available, it's still in commercial production, and it's relatively simple to program (I've seen someone write industrial control software with nothing but a legal pad and a calculator). As a bonus, the kit has been designed to fit onto the Parallax Board Of Education Robot (BoE-bot) frame. This kit does not contain the hardware needed to operate the BoE-bot chassis, but I'm developing an ecosystem of boards to provide that functionality.
- Designed around the Rockwell 65C02 microprocessor and equivalents
- 32k x 8 bit SRAM
- 32k x 8 bit flash non-volatile storage ("ROM")
- 16C550 UART (16 byte FIFO for both TX and RX, standard modem interface)
- Power On Reset (POR) monitor circuit
- Complex Programmable Logic Device (CPLD) (implements 'glue' logic)
- Expansion header (provides power, ground, data bus, address bus, clocks, and three memory mapped assert signals)
- On-board 5V power supply
- 3.050" x 4.000" four layer printed circuit board
- 0.25" mounting holes on 2.750" x 3.700" centers (compatible with Parallax BoE-bot chassis)
EPS and PNG.
The kit, as shipped, cannot utilize the extra space on the flash chip.
- +5VDC power
- Eight bit data bus
- Address lines A0, A1, and A2
- Phi-2 clock signal
- Phi-1 clock signal
- Read/#Write signal
- Interrupt Request (#IRQ) signal
- Non-maskable Interrupt (#NMI) signal
- Two-bit memory mapped prehiprial assert signals
Memory mapped prehiprial assert signals (XPAN Assert Signals) are active low, and their label number matches their bus value:
|Bus Value (#XA1, #XA0)||Memory Block Address Range (inclusive)||Description|
|0||0||0x7FD0||0x7FD7||XPAN Assert Signal 0|
|0||1||0x7FD8||0x7FDF||XPAN Assert Signal 1|
|1||0||0x7FE0||0x7FE7||XPAN Assert Signal 2|
|1||1||N/A||N/A||No prehiprial selected|
Verilog code and Serial Vector Format (.svf). If you do want to modify the CPLD firmware you will need to download Alteras CPLD/FPGA development software, Quartus II. A stripped-down free version is available although you may need to create an account. You will also need a appropriate JTAG cable/dongle and programming software that interprets the file generated by Quartus and programs the resulting bitstream into the CPLD. For the development of this project I used a clone of an Altera ByteBlaster parallel port cable and ran the Quartus software inside a virtual machine on my workstation. The CPLD is programmed and debuged via the Joint Task Action Group (JTAG) Test And Program (TAP) port. Most people just refer to these ports as 'JTAG sockets' or similar. On this board the TAP port is labeled 'JTAG' and is on the right hand side, near the edge. The pinout is identical to the standard Altera and Atmel AVR JTAG adapter cables:
I also attempted to use UrJTAG along with a Xilinx DLC-5 cable but was unsuccessful. YMMV.
Here is an alternate solution:
There is a nifty little Linux utility called flashrom (a spin-off project from the Coreboot project) that allows users to read/erase/write the contents of flash chips on mainboards, network/graphics/storage controller cards, and various other programmer devices. Most mainstream distributions will probably have it in their repositories. As luck would have it, a number of older network cards have a PLCC-32 socket on them for a flash or ROM chip, intended to hold firmware and data needed for booting a computer over a network connection. One can usually find these cards at swap meets or recyclers for a few dollars, if they don't already have a suitable card in a spare parts box somewhere. The flashrom supported hardware page is extensive. I personally used a SMC 1211TX Ethernet network card which falls under the nicrealtek driver on a system running Fedora 20: WARNING: Modifying the contents of the wrong chip may render your computer non-functional! Verify the chip part number and card PCI address!
Values used below are for example purposes only, your commands may vary!
[root@localhost ~]# flashrom -p nicrealtek:pci=00:0a.0 flashrom v0.9.6.1-r1705 on Linux 3.12.6-300.fc20.i686+PAE (i686) flashrom is free software, get the source code at http://www.flashrom.org Calibrating delay loop... OK. Found SST flash chip "SST39SF010A" (128 kB, Parallel) on nicrealtek. No operations were specified. [root@localhost ~]# flashrom -p nicrealtek:pci=00:0a.0 -r backup_flash.rom [root@localhost ~]# flashrom -p nicrealtek:pci=00:0a.0 -w new_flash.romIt is important to note that the interface for many parallel interface flash chips are identical; just because a given chip is not on the list does not mean flashrom can't be forced to program it.