HomeIoTCommodore 64 Keyboard-to-USB Converter for Use with VICE and MISTer

Commodore 64 Keyboard-to-USB Converter for Use with VICE and MISTer



Software program emulators like VICE and {hardware} re-implementation (FPGA) choices like MISTer emulate the Commodore 64 pc. They each do a unbelievable job of replicating the low-level {hardware}’s habits. Nonetheless, one facet neither resolution has an excellent resolution to emulate is the bodily keyboard. The Commodore 64 didn’t use an ASCII-compatible keyboard. Additionally, it comprises many Commodore-specific keys. (The particular symbols are known as “PETSCII.”) So it’s terrific to see YouTuber Rumbledethumps adapt a Commodore 64 keyboard to USB with a Pi Pico — after which help each emulation choices!

The Commodore VIC-20 and C64 have the identical keyboard format and interface. Many of the keys are on a matrix. The one one that’s separate is the RESTORE key, which is linked to a one-shot timer to supply a correctly timed reset pulse. By scanning the keyboard matrix, you possibly can see which keys are pressed and act accordingly.

At the moment keyboards comprise a devoted microcontroller after which speak to the pc through USB (or Bluetooth.) However again within the 8-bit pc period, the keyboard linked to some controller on the logic board. For instance, a devoted “keyboard encoder” scanned the matrix within the Apple II sequence. This encoder was a 6502 microprocessor with masked ROM! Alternatively, the C64 keyboard interfaces to a 6522 peripheral controller, counting on the CPU to scan the matrix.

Because the keyboard is “simply” a matrix, it’s comparatively straightforward to interface with a contemporary microcontroller. Within the case of the C64, the keyboard has a 2.54mm header-socket connector. So, it’s straightforward to attach the standalone keyboard to the GPIO pins of a Pi Pico — which is what Rumbledethumps CBM2USB does!

The actual trick of this venture is what to do with the decoded keyboard indicators. CBM2USB has three operation modes: ASCII, VICE, and MISTer. VICE and MISTer map a PC’s USB keyboard barely totally different from one another, so that you want barely totally different maps. Additionally, every has totally different “hotkey” mixtures to carry out actions throughout the emulator. The ASCII mode is beneficial for computer systems that settle for ASCII inputs.

One such instance is Rumbledethumps’s Picocomputer. It’s a 6502-based pc that makes use of Pi Picos for energy, clocking, video, audio, WiFi, and USB. ASCII mode works with it. So, there’s a Pi Pico to rework the C64 keyboard right into a USB gadget. After which one other Pi Pico to switch the USB keyboard again into ASCII!

You will discover 3D-printable STLs for keyboard stand-offs and code examples within the CBM2USB repository. Rumbledethumps additionally offered detailed Pi Pico C-code examples that construct as much as the ultimate code.



RELATED ARTICLES

Most Popular

Recent Comments