Skip to the content
4 layers77.7 × 33 mmGP2040-RE, the printed circuit board in 3D

GP2040-Retro Edition

Size
77.7 × 33 mm
Copper layers
4
Thickness
1.6 mm
Parts
71
Nets
72
Pads
280
Tracks, vias
82, 14
Pours
2
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
11 Mar 2024
Updated
11 Aug 2024

Overview

GP2040-RE is an open-source printed circuit board by Fortinbra, from the Fortinbra/GP2040-RE repository on GitHub, published under the MIT licence. It is a 4-layer board of 77.7 × 33 mm with 71 parts on 72 nets, routed with 82 tracks and 14 vias.

It is built around the RP2040, BSS138 and SIT1602BC-33-33E-12.000000T, with the SM03B-SRSS-TB(LF)(SN)(P) and USB4105-GF-A among its other parts. Its parts include 24 resistors, 18 capacitors, 9 connectors, 6 transistors and 3 ICs. It belongs with the RP2040 boards of this library.

Main components

5

README

README.md

GP2040-RE

GP2040-Retro Edition

What this is

The purpose here is to add the ability to use your GP2040-CE controller with older consoles that do not have USB support. So this project is not a contoller on it's own, and requires the use of another gamepad for the actual controller functions. This is just the transport level to connect to the consoles themselves.

Getting Started

GP2040-CE

The features required on the GP2040-CE side of this have not been released yet, and this will be updated with the version number as soon as they are.

Hardware

This project operates as a target I2C device. (Formerly called a slave device). At minimum a Raspberry Pi Pico is required. Pico W will not be supported, as wireless is not on the roadmap here, and we will be utilizing all the RP2040 pins eventually, not leaving any for the SPI bus required for wireless functions. A level shifter is used to bring the 3.3V logic of the Pico up to the 5V logic of the SNES (the only suppored retro console so far). A diode is necessary so that we can use the 5V line from the SNES as the reference voltage for the high side of the level shifter, and not accidentally backfeed anyting to the SNES. A pull up resistor is required on the Data line, as it's an open-drain, and should be normallly high. The SNES does have a 5V line that is documented to provide up to 25mA across both controller ports, and there are examples of devices utilizing that as a power source for similar projects to this. To be safe with the geriatric console, I'm opting for external power.

Firmware

This document assumes you know how to build and flash your own firmware. All pin configurations are in config.h.

Building your own

So this will be a breadboard edition.

Required Materials
  • Raspberry Pi Pico

  • 3.3v-> 5v level shifter

    • must support open-drain signals
    • must be bi-directional
  • SNES controller cable

  • Powersource for the Pico

    • can be USB or a battery bank
    • can be powered directly from GP2040-CE controller
  • GP2040-CE controller with available I2C connection

    • does not work with the OLED

    Starting with the SNES controller cable, you'll need to identify which wires are attached to which pins. Official nintendo cables do follow a specific wiring color scheme but are increasingly hard to acquire.

SNES Controller Connector:

text
    ----------------------------- ---------------------
  |                             |                      \
  | (1)     (2)     (3)     (4) |   (5)     (6)     (7) |
  |                             |                      /
   ----------------------------- ---------------------
  1. Vcc (+5V)
  2. Clock
  3. Latch
  4. Data
  5. Not Connected
  6. Not Connected
  7. Ground
Breadboarding at it's best

With the Pico attached to your breadboard, you'll want to add your level shifter, and wire it to the Pico with jumpers. If using the TXS0108 from Texas instruments, you would need GPIO pins 2-7 on the Pico to connect to pins A2-A7 on the level shifter. You'll want to connect the level shifter's ground to the Pico's ground (the entire project will have common ground, so make sure everything is connected). We also want to connect the level shifter's VCCA pin to the Pico's 3v3 pin. If your OE pin does not have a resisotor in it' breakout board, you'll want to use one to pull it to ground.

On the other side, let's connect the SNES controller to the level shifter. Pin 1 will go to a diode first, then the diode will connect to the VCCB pin on the level shifter. Ground will connect to our common ground. Pin 4 (Data) will connect to B5 on the shifter. Pin 3 (Latch), will connect to B3, and Pin 2 (Clock), will connect to B1. (Diagrams to come soon)

Next lets connect to the GP2040-CE controller. This is I2C, so we'll have four pins to deal with. The 3v3 pin from the I2C should connect to the VSYS pin on our Pico. The ground pin should be connected to our common ground setup. And finally, the SDA and SCL pins should be connected to GPIO 16 (SDA), and GPIO 17 (SCL) which is part of I2C0 on the Pico.

If you'd like to do UART monitoring, the button outputs can be seen using the UART on GPIO 0 and 1.

The Future

  • NES Support
    • Need a console to test against
    • Same protocol as SNES
  • SNES Support
    • In progress
  • N64
    • Uses JoyBus protocol
    • Memory card support
  • GameCube
    • Uses JoyBus protocal
  • Playstation 1 & 2
    • No Analog face button support at this time (PS2).
  • Dreamcast
    • VMU suppport

Would be nice

  • Readily available connector with more than 8 pins, to support Sega, Atari, and NEOGEO consoles too.

Deeper Dive - SNES

Communication protocol

The communication protocol on the SNES is based on a 4021 PISO shift register, and depending the manufacture date of the controller, it may physically have two shift registers in a chain, or one 16bit register. Ether way, the output is the same.

When the Latch pin is high, it signals the shift register to start sending data according to the clock pulses. What is commonly documented incorrectly, is regarding the first data pulse. The data is sent as a low signal on the rising edge of the clock pin. However, when the latch is high at the beginning, the clock is also already high, so the first data pulse needs to begin immediatly. Overall, there will be 16 data pulses sent, the first twelve will be active low pulses representing the button state of the 12 buttons on the controller. The last 4 will be always high. On the trailing edge of the last clock pulse, the data will be pulled low one last time, before going back to it's default high state, and the cycle starts all over again. The entire report is done in 16.67ms. The button reports are always in the same order: B, Y, SELECT, START, UP, DOWN, LEFT, RIGHT, A, X, L, and R. The NES uses this same protocol, with a slightly different button order. A, B, SELECT, START, UP, DOWN, LEFT, and RIGHT

https://buymeacoffee.com/fortinbra

Parts

71
QtyValueFootprintReferences
1210KResistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR6, R7, R15, R16, R17, R18, R19, R20, R21, R22, R23, R24
11100n 6.3V X5R 10%Capacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C15
6BSS138Package_TO_SOT_SMD:SOT-23Q1, Q2, Q3, Q4, Q5, Q6
42.2u 6.3V X5R 20%Capacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC1, C12, C13, C14
4MountingHoleMountingHole:MountingHole_2.5mmH1, H2, H3, H4
3100K 50mW 1%Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR8, R10, R14
320V 1AGP2040-RE:SDO_SOD-123FL_ONSD1, D2, D3
347u 6.3V X5R 20%Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC16, C17, C18
227 50mW 1% M0603Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR12, R13
24.7kResistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR2, R3
25K1Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR4, R5
2ButtonsGP2040-RE:SW_EVP-BB2A9B000S1, S2
116MGP2040-RE:USON-8_UX_2x3x0p6_WINU2
11K 50mW 1%Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR1
11uHGP2040-RE:IND_SRN2512_BRNL1
1560K 50mW 1%Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR9
1CONN HEADER R/A 6POS 2.54MMGP2040-RE:WURTH_61200621721J2
1Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ9
1Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ5
1Conn_01x10Connector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_VerticalJ8
1I2C TargetGP2040-RE:CONN_SM04B-SRSS-TB_JSTJ1
1Linear RegulatorGP2040-RE:QFN_4AGQW_RITU3
1RJ-45GP2040-RE:CONN8_2-908LF_AMPJ7
1RP2040GP2040-RE:QFN56_7X7_RPIU1
1SIT1602BC-33-33E-12.000000TGP2040-RE:SON4_SIT1602-3_SITXTAL1
1SM03B-SRSS-TB_LF__SN_GP2040-RE:JST_SM03B-SRSS-TB_LF__SN_J3
1USB4105-GF-AGP2040-RE:GCT_USB4105-GF-AJ4
1VREF SHUNT 2%GP2040-RE:DBZ3R11
1microSDGP2040-RE:MEM2061-01-188-00-A_GCTJ6

More from Fortinbra/GP2040-RE

1
  • 2 layers96.4 × 45.3 mmGP2040-RE, the printed circuit board in 3D

    GP2040-RE

    Fortinbra/GP2040-RE

    GP2040-Retro Edition

    17 parts3MIT

Similar boards

  • 4 layers70 × 82 mmRoomsensor, the printed circuit board in 3D

    Roomsensor

    marmbrus/circuits

    115 parts
  • 2 layers39.5 × 64.7 mmTesty, the printed circuit board in 3D

    Testy

    mmalex/wookash_thing

    a small rp2040 based thing for a livestream with wookash

    65 parts10MIT
  • 4 layers56.4 × 56.4 mmNema23Driver, the printed circuit board in 3D

    Nema23Driver

    neatstranger/Dagerro

    Open Source Astrophotography Hardware and Software

    60 parts3
  • 2 layers30 × 30 mmROS2Stamp, the printed circuit board in 3D

    ROS2Stamp

    pablogs9/ROS2Stamp

    38 parts
  • 6 layers67.6 × 50 mmGMA1 SOM, the printed circuit board in 3D

    GMA1 SOM

    cdg66/GMA1-2_SOM

    26 partsMIT
  • 4 layers21 × 51 mmBaker link dev, the printed circuit board in 3D

    Baker link dev

    Baker-link-Lab/baker-link-dev-hardware

    74 partsCERN-OHL-P-2.0
  • 6 layers40 × 40 mmDragonfangFC, the printed circuit board in 3D

    DragonfangFC

    Kozma04/dragonfang-fc

    190 parts

Questions

How big is the GP2040-RE PCB?

It measures 77.7 × 33 mm and has 4 copper layers, 1.6 mm thick.

What parts does the GP2040-RE use?

71 parts, built around the RP2040, BSS138, SIT1602BC-33-33E-12.000000T and SM03B-SRSS-TB(LF)(SN)(P). 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 GP2040-RE KiCad files?

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

Can I use the GP2040-RE design in my own project?

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