Skip to the content
2 layers57 × 62 mmPicocart, the printed circuit board in 3D

Let your Raspberry Pi Pico pretend to be a Commodore 64 ROM cartridge

Size
57 × 62 mm
Copper layers
2
Thickness
1.6 mm
Parts
14
Nets
71
Pads
200
Tracks, vias
1,190, 72
Pours
7
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
11 Mar 2022
Updated
21 Jul 2022

Overview

Picocart is an open-source printed circuit board by cknave, from the cknave/c64-pico-ram-interface repository on GitHub, published under the BSD-3-Clause licence. It is a 2-layer board of 57 × 62 mm with 14 parts on 71 nets, routed with 1,190 tracks and 72 vias.

It is built around the SN74LV244APWRE4. Its parts include 3 capacitors, 3 ICs, 2 resistors, 2 connectors and 1 diode. It belongs with the retro computing and games boards and the RP2040 boards of this library.

Main components

1

README

README.md

Commodore 64 to Raspberry Pi Pico RAM interface

This project exposes a 16 KiB window of a Raspberry Pi Pico's RAM to a Commodore 64 via the expansion port. It includes a hardware design and software for the Pico C++ SDK.

PCB photo PCB imageDemo video thumbnail Demo video

The hardware

Schematic PDF

Schematic, PCB, and project files are in KiCad 6 format.

5V power from the expansion port is used to power the Pico. As suggested in the Pico datasheet, a Schottky diode allows the Pico to be connected to powered USB at the same time.

8-bit buffers bring the 5V logic levels on the address and data bus down to 3.3V to protect the Pico's GPIO pins. This means that when the C64 reads from the Pico, it's putting a 3.3V signal on the data bus. At TTL logic levels, this should be fine.

A switch allows you to toggle between an 8K ROM and a 16K ROM by pulling the /GAME line low. This loses half the address space, but lets you boot into BASIC.

The tolerances on the PCB design are compatible with JLCPCB. I ordered my prototypes from them with ENIG surface finish and gold fingers on a 1.6mm thick board. You can get them made much cheaper with HASL, but it will eventually scrape off as you reinsert the board.

The firmware

Given a 16 KiB-aligned base address on the Pico's address space, four PIO state machines and two DMA channels handle reading addresses from the C64 address bus and writing the requested data to the C64 data bus. The CPU is not needed once this is configured.

To allow the C64 to communicate with the Pico, a 256 byte command area is reserved that will put that byte onto the RX FIFO for the CPU to consume. The CPU can put any value onto the TX FIFO to signal that it is ready for more commands.

Between the GPIO pins and the RAM, there are five logical components:

  • address_decoder PIO state machine: monitors the /ROML and /ROMH lines for reads, checks if the address is for the special command area, and wakes up either the read or command state machines as needed. Two copies of this state machine run at the same time, monitoring /ROML and /ROMH.

  • read PIO state machine: reads the address lines, sends the address to DMA, and writes the returned data to the data bus

  • command PIO state machine: reads the low 8 bits of the address, and copies it to the RX FIFO for the CPU to handle. It writes the STATUS register back to the data bus, indicating if the CPU is busy or not. The CPU can indicate its readiness by writing any value to the TX FIFO.

    The special value 00 will not be sent to the CPU at all, allowing the C64 to poll the status register until the Pico is finished processing a command.

  • DMA channel 1: write the incoming address to the configuration of DMA channel 2, triggering a read

  • DMA channel 2: copy a byte at the requested RAM address to the read PIO state machine

Read sequence

Command sequence

It's a Rube Goldberg machine, but the Pico's PIO controllers and DMA can do this in well under the time required by the C64's CPU.

Further improvements

Could this work as a 16K ROM and IO ports?

Maybe, but this design is already using all the GPIO pins on the Pico. Even if you replace the "input enable" pin (you can probably get away without it), you'll also need to monitor PHI2. In my experience, the IO lines are glitchy and you need to make sure that you're actually in the right part of the clock cycle to use them.

You could try using a shift register to free up a bunch of pins, but you'll waste a lot of PIO clock cycles shifting all the bits through it. It might be fast enough to only shift a couple of bits.

Could I use all 44 KiB of the available address space?

I think you're definitely in shift register territory at this point, and good luck trying to decode more than a couple of address prefixes in PIO. If you actually do this, please contact me because I want to see it!

Legal

Distribute under the terms of the BSD 3-clause license.

The KiCad-RP-Pico footprint is by Nicolò Carandini.

Parts

14
QtyValueFootprintReferences
30.1μFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC1, C2, C3
3SN74LV244APWRpicocart:SOP65P640X120-20NU1, U2, U3
210KΩResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR1, R2
1D_SchottkyDiode_SMD:D_SMAD1
1ExpansionPortpicocart:C64ExpansionEdgeShortJ1
1Picopicocart:RPi_Pico_SMD_THJ2
1SW_SPSTConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalSW1
1Val**picocart:logoRef**

The 13 most common of 14 parts.

Similar boards

  • 2 layers116.8 × 30 mmType d, the printed circuit board in 3D

    Type d

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    14 parts3kApache-2.0
  • 2 layers32 × 22 mmDiff driver, the printed circuit board in 3D

    Diff driver

    rene-dev/stmbl

    AC Servo Driver for STM32F4

    14 parts990GPL-3.0
  • 2 layers34 × 45 mm2032Charger, the printed circuit board in 3D

    2032Charger

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    14 parts915
  • 2 layers34 × 109.9 mmTdisplay s3, the printed circuit board in 3D

    Tdisplay s3

    landonr/homeThing

    Wifi Smart Home Remotes that run on ESPHome

    14 parts551GPL-3.0
  • 2 layers45.3 × 42.7 mmMainPcb, the printed circuit board in 3D

    MainPcb

    adamb314/ServoProject

    Getting the most out of your hobby servo

    14 parts545
  • 2 layers42.5 × 28.8 mmC5VRX JACK DIY, the printed circuit board in 3D

    C5VRX JACK DIY

    Twotoz/C5VRX

    Ultra-minimal, zero-CPU 5.8 GHz analog FPV video receiver using ESP32-C5 Wi-Fi 6 PHY MODEM_DIAG, BitScrambler WBFM demodulation & resistor DAC CVBS

    14 parts515GPL-3.0
  • 2 layers62 × 24 mmMai button, the printed circuit board in 3D

    Mai button

    whowechina/mai_pico

    Pico controller for Maimai

    14 parts475

Questions

How big is the Picocart PCB?

It measures 57 × 62 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Picocart use?

14 parts, built around the SN74LV244APWRE4. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Picocart KiCad files?

From the cknave/c64-pico-ram-interface repository on GitHub, at the commit this page was made from: the board is pcb/picocart.kicad_pcb and its schematic pcb/picocart.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Picocart design in my own project?

Its repository publishes it under the BSD-3-Clause licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).