Skip to the content
2 layers62.5 × 47.5 mmC64UserPortMidi, the printed circuit board in 3D

Simple MIDI input and output interface using Commodore 64 user port. Utilizes an ATtiny2313 microcontroller and 6n138 opto-isolator.

Size
62.5 × 47.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
25
Nets
45
Pads
108
Tracks, vias
172, 21
Pours
1
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
25 Feb 2021
Updated
3 Jan 2023

Overview

C64UserPortMidi is an open-source printed circuit board by relic-se, from the relic-se/C64UserPortMidi repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 62.5 × 47.5 mm with 25 parts on 45 nets, routed with 172 tracks and 21 vias.

It is built around the ATTINY2313-20PU. Its parts include 7 resistors, 4 capacitors, 4 connectors, 2 ICs and 2 diodes. It belongs with the interfaces and adapters and retro computing and games boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md

Commodore 64 User Port Midi Device

Simple Midi Input & Output via the Commodore 64 User Port Interface
Created by D Cooper Dalrymple 2021 - dcdalrymple.com
Licensed under GNU GPL V3.0

I found myself in possession of a Commodore SX-64 and a desire to make music with it. After quickly finding Cynthcart, I wasn't too happy about the idea of plugging both the Cynthcart cartridge and a separate Datel midi cartridge into in a Mini X-Pander+ all sticking out of the hood of my SX-64. I had assumed that the User Port would have been a great interface for transmitting the necessary midi input data to whatever SID program you're jamming with. That's where this project comes in.

First development unit of C64UserPortMidi with 3d-printed case

Functionality

The concept is fairly simple: the stream of data from the midi input will be piped into a buffer by the microcontroller. After representing the value of each byte on the data bus of the user port (PB0-7), it will then trigger the user port's flag interrupt (FLAG2) to indicate new data is available. The compatible Commodore software that has an interrupt registered for the user port's flag pin then adds that 8-bit data register to a data buffer. The midi information would then need to be processed by the main loop of the software. Easy peasy!

I am aware that there are serial lines available on the user port that have been used for RS-232 communication and such, but I wanted to use the least amount of resources when transferring data from the bus to the Commodore software. A simple lda $DD01 is all that is necessary to get the full byte during a flag interrupt.

The 8 bits of the user port are bi-directionally connected to the microcontroller, and a data transfer back to the microcontroller can be flagged using the dedicated GPIO pin, PC2. This functionality can be used to send midi data back out through the Midi Out port and perform additional functionality that has yet to be developed (channel filters, etc).

Components

The microcontroller chosen for this project is the ATtiny2313. Using this micro reduces the total BOM by not requiring an external crystal oscillator, operating at 5V, including a hardware UART controller, and having just the right amount of GPIO.

Overall, the BOM is fairly minimal and using only through-hole components for easy assembly. To quickly get started making your own, I've assembled a Digikey shared cart with the exact hardware requirements and all of the necessary gerber files to order your own PCBs from a distributor such as PCBway.

Schematic of C64UserPortMidi v1.0 RevA

Development Status

I've just completed revision A of the hardware design which migrated from the ATtiny13 to ATtiny2313 and removed the need for a shift register. I've also added the components required MIDI output since the new microcontroller should be able to handle UART transmission with ease.

PCB Design of C64UserPortMidi v1.0 RevA

The firmware hasn't yet been updated for this new board design, but the functionality should mostly remain the same within the C64 software. I'll provide examples of bidirectional data transfer showcasing the output functionality of the new board once any bugs have been worked out.

I advise from producing your own units until the hardware and software have been fully developed.

Software

A testing cartridge for the C64 is in development and mostly complete. This easily fits on a small 4kb/8kb lo-rom cart and could be compiled for floppy if needed. It can be run in emulation, but it isn't very useful unless the debugging data is enabled.

I plan to fork the Cynthcart repo once testing is completed to include full compatibility with this device.

Parts

25
QtyValueFootprintReferences
5220Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R2, R4, R5, R6
30.1uFCapacitor_THT:CP_Radial_D5.0mm_P2.00mmC1, C2, C3
110kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR7
110uFCapacitor_THT:CP_Radial_D5.0mm_P2.00mmC4
11N914Diode_THT:D_DO-35_SOD27_P7.62mm_HorizontalD1
12N3904Package_TO_SOT_THT:TO-92_InlineQ1
14.7kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR3
16N138Package_DIP:DIP-8_W7.62mm_Socket_LongPadsU2
1ATtiny2313-20PPackage_DIP:DIP-20_W7.62mm_Socket_LongPadsU1
1AVR-ISP-6Connector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_VerticalJ3
1C64-UserPortCommodore64C:Connector_Edge_2x12_P3.96mmJ1
1LEDLED_THT:LED_D3.0mmD2
1MIDI INVideo Connectors:din-5J2
1MIDI OUTVideo Connectors:din-5J4
1MIDI Output BypassJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP1
1PC2TestPoint:TestPoint_THTPad_D1.5mm_Drill0.7mmTP4
1PD4TestPoint:TestPoint_THTPad_D1.5mm_Drill0.7mmTP1
1PD6TestPoint:TestPoint_THTPad_D1.5mm_Drill0.7mmTP3
1RST BypassJumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mmJP2

Similar boards

  • 2 layers88 × 102 mmFakedeck gerber, the printed circuit board in 3D

    Fakedeck gerber

    syuchan1005/Fakedeck

    Using raspberry pi pico as a stream deck

    14 parts9
  • 2 layers174 × 80 mmKeyb, the printed circuit board in 3D

    Keyb

    coprolitebbs/ps2-keyboard

    Самодельная клавиатура с интерфейсом ps/2. Собрана на Attiny2313A и сдвиговых регистрах 74HC595 и 74HC165.

    115 parts7GPL-3.0
  • 2 layers50 × 60.5 mmDps5005control, the printed circuit board in 3D

    Dps5005control

    firew4lker/DPS5005-control

    A baord to control the DPS5005c power supply.

    26 parts7
  • 2 layers437.8 × 127.8 mmC128DKEYBOARD, the printed circuit board in 3D

    C128DKEYBOARD

    danwerner21/C128D_Keyboard

    C128D_Keyboard

    119 parts1
  • 2 layers170 × 50.5 mmPcb v0, the printed circuit board in 3D

    Pcb v0

    oskar-ka/nixie

    Various files for my nixie tube project

    33 parts
  • 2 layers91.4 × 53.3 mmClock, the printed circuit board in 3D

    Clock

    shimo8810/rust-board

    Hobby board implemented in Rust

    53 partsMIT

Questions

How big is the C64UserPortMidi PCB?

It measures 62.5 × 47.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the C64UserPortMidi use?

25 parts, built around the ATTINY2313-20PU. 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 C64UserPortMidi KiCad files?

From the relic-se/C64UserPortMidi repository on GitHub, at the commit this page was made from: the board is hardware/C64UserPortMidi.kicad_pcb and its schematic hardware/C64UserPortMidi.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the C64UserPortMidi design in my own project?

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