Close
0%
0%

PLACARD: homebrew computer built from 22V10 PLDs

8-bit CPU/GPU, 640x480 VGA, made of 20 ATF22V10 PLDs and a few 74-series chips, all DIP through-hole.

Similar projects worth following
0 followers
PLACARD is a complete 8-bit home computer designed from scratch around the 22V10 programmable logic device, the same family of PAL/PLD chips that glued together the computers of the 70s/80s. There is no single-chip processor, no FPGA in the final design: the CPU, the VGA video generator, sound, memory control and I/O are built from 20 ATF22V10C PLDs plus 13 ordinary 74-series and SRAM chips. Every part is a through-hole DIP that is still in production.

It shows 640x480 VGA with up to 256 colors, plays 8-bit sound, takes a PS/2 keyboard and mouse and two SNES pads, and loads its ROM from a plug-in cartridge, and has native support for an SD card for hard drive storage.

The whole machine runs today on a Basys 3 FPGA board, where each PLD is a VHDL model of its CUPL equations.

Current status: KiCad schematics and fab-ready Gerbers for the 4-layer main board are ready for ordering.

Project goals:

  • Retrocomputer using 1970s/early 1980s type of technology
  • Through-hole only (strongly preferring DIP)
  • Only parts in active production (no ebay/shady distributors)
  • An instruction set that is fun to program 
    • No racing the beam
    • No counting instructions for timing
    • Bare-metal - no virtual machines to program
    • Therefore, a true von Neumann CPU (no Harvard)
    • Native storage so you can write and save programs on the machine itself
  • Fast as the day is long

Why PLDs?

The project started as a pure 7400-series computer, but to meet the goals I conceded it would take too many simple gate chips to achieve it.  So I swapped some gates for 22V10s.  The first PLA was on the market in 1970 - the first PLD in 1977, so thematically it still meets project goals.  It ended up 33 chips on the main board plus a 3.3 V regulator, and 3 on the cartridge.  

This computer was inspired by the ones which came before - the Gigatron, Ben Eater's, Novasaur, Isetta.  There are similarities in the architecture.

CPU

  • 8-bit data, 16-bit address, von Neumann, 25.175 MHz clock (the VGA pixel clock).
  • Instructions take 2, 3 or 4 clocks
  • Registers: accumulator, X, Y and D (immediate/memory operand), each a 74F377.
  • Controlled by a 4-state machine (FETCH, LOAD_IMM, LOAD_MEM, EXECUTE) in one PLD
  • ALU: two 22V10s, 4 bits each, with zero, sign and a carry flag (reminiscent of the obsolete -181 ALUs)
  • Program counter: two 8-bit loadable counter PLDs.
  • Address mux: four PLDs pick Program Counter, zero page, [Y,X] or the video address.
  • Addressing: immediate, [0,D] and [0,X] zero page, and [Y,X] 16-bit.
  • Instruction register is itself a PLD, which also holds a NOP while the cartridge loads so the CPU waits without gating the clock.

Video

  • 640x480 VGA at 60 Hz, generated by H counter, V counter and sync PLDs.
  • Uses RAM as raster memory (x6020-xFFFF)
  • Video runs automatically - stalls CPU when it needs to read from RAM
  • Colors modes are adjustable per line:
    • 640 monochrome pixels or
    • 320 4-color pixels or
    • 160 16-color pixels or
    • 80 256-color pixels
  • RAM can be conserved by select lines to repeat
    • 1x mode reads every line
    • 2x mode skips every other line (half of required RAM)
    • 4x mode skips 3 lines at a time (quarter of required RAM)
  • Modes mix freely down the screen: 80-column text above a 256-color picture, for example.
  • Each row can be tinted with another 8 colors
    • Gives colored text backgrounds and raster bars for free.
    • Provide some background color in monochrome mode
    • Provide color gradients in other color modes
  • Each RAM byte is processed by the Color Decoder PLD which turns it into RGB with a resistor DAC.

Memory

  • 64 KB RAM (two AS7C256 15 ns SRAMs) and 64 KB of ROM space behind the same addresses, in eight 8 KB sections; 
  • A 8-bank select register picks RAM or ROM per bank for reads (writes always go to RAM)
  • Dedicated I/O window at x5000-x53FF address space
  • The video reads the same RAM as the CPU: the video area is x6020-xFFFF, and the video circuit steals clock slots from the CPU in a fixed pattern, so software never has to time its code to the beam.

Sound

  • Borrows video automation counter to read one 8-bit sample per scan line (31.47 kHz, one frame), 
  • Load your sound table and sit back.  No worrying about getting the next sample ready in time.
  • Latched into a 74HCT574 and an R-2R ladder DAC to a line-out jack. 
  • Library ROM makes tones, notes, noise and sample playback.

I/O

  • PS/2 keyboard and PS/2 mouse (a PLD shifts in each byte).
  • Two SNES game pads.
  • SD card (SPI, FAT16/FAT32, read and write).
  • Four expansion slots with their own boot code hook (like the Apple II).
  • Cartridge slot: the cartridge holds the ROM image in a (slow) EEPROM 
    • Copies it into fast SRAM at power-up while it stalls the CPU. 
    • 32K and 64K cartridge boards are designed.

Software

  • Standard library in ROM with an append-only jump table: 16-bit math, multiply/divide, text console with line input, graphics, keyboard, mouse, pad and SD drivers, a FAT file reader/writer,...
Read more »

  • 20 × ATF22V10C-7PX Logic ICs / Programmable Logic: PLDs: CPU state machine, branch, PC, ALU, address mux, memory control, I/O decode, video timing, color decoder, IR, audio, ports, PS/2
  • 5 × SN74F377AN Logic ICs / Flip-Flops, Latches, Registers - D, AC, X, Y registers and the pixel buffer
  • 1 × CD74HCT377E Logic ICs / Flip-Flops, Latches, Registers - ROM/RAM map register
  • 3 × SN74F541N Logic ICs / Buffers, Drivers, Transceivers - Source bus drivers, video line read
  • 2 × AS7C256C-15PCN 32K 15ns RAM chips

View all 9 components

  • Holding off

    Justin Davis • an hour ago • 0 comments

    I've waited to open the project up until the last minute.  I wanted to get boards in hand before going public, but I want to submit to this year's retrocomputer challenge.

    I wanted to verify the timing and logic of the design in VHDL before I started with chips.  It's much easier to make design changes with a few lines of code than rewiring solderless breadboards.  I can load the ROM as a memory initialization file.  I made the top-level VHDL code structural to represent the schematic for the board.  I wanted each PLD a module with only its equations inside.  Some registers are just processes, but that's ok.  The Basys3 is an easy board for this since it has a VGA output and plenty of LEDs/buttons to simulate functions.  It has a USB port to simulate a PS/2 keyboard or mouse.

    Everything is fully operational on the FPGA.  Software development can continue on the FPGA for the library and demos/benchmarks.  It should perform the same as the board.

    Of course, the end goal is getting a board made.  So I have the KiCad main board and cartridge schematics finished.  The board is 95% routed, so I should be ordering boards any day now.  

View project log

Enjoy this project?

Share

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates