Classify DB-25 pins based on usage and re-map ESP32 pins to match that usage

This commit is contained in:
Travis Burtrum 2020-12-29 13:26:46 -05:00
parent 06b907c776
commit 22682572de
2 changed files with 48 additions and 54 deletions

View File

@ -25,34 +25,36 @@ Wiring
| DB-25 Pins | Arduino Pro Micro GPIO | ESP32 GPIO | Radio | SNES | PSX | N64 | Gamecube | Genesis | | DB-25 Pins | Arduino Pro Micro GPIO | ESP32 GPIO | Radio | SNES | PSX | N64 | Gamecube | Genesis |
|---------------|------------------------|------------|----------|--------|--------|----------|----------|-------------| |---------------|------------------------|------------|----------|--------|--------|----------|----------|-------------|
| 1 | 1 | 15 | - | - | - | - | - | P1-1 | | 1 TX | 1 | 1 | - | - | - | - | - | P1-1 |
| 2 | 2 | 2 | - | LATCH | DATA | DATA1 | DATA1 | P1-3 | | 2 SDA | 2 | 21 | - | LATCH | DATA | DATA1 | DATA1 | P1-3 |
| 3 | 3 | 4 | - | CLOCK | CMD | - | - | P1-4 | | 3 SCL | 3 | 22 | - | CLOCK | CMD | - | - | P1-4 |
| 4 | 4 | 16 | - | - | ATT | - | - | P1-6 | | 4 Analog | 4 | 15 | - | - | ATT | - | - | P1-6 |
| 5 | 5 | 17 | - | - | CLK | - | - | P1-7 | | 5 Digital | 5 | 16 | - | - | CLK | - | - | P1-7 |
| 6 | 6 | 5 | - | - | - | - | - | P1-9 | | 6 Analog | 6 | 2 | - | - | - | - | - | P1-9 |
| 7 | 7 | 18 | CE | - | - | - | - | P2-7* | | 7 Digital | 7 | 17 | CE | - | - | - | - | P2-7* |
| 8 | 8 | 19 | CSN | - | - | - | - | - | | 8 Analog | 8 | 4 | CSN | - | - | - | - | - |
| 9 | 9 > 1k Ω | 35 > 1k Ω | - | 330 Ω | 100 Ω | 220 Ω | 680 Ω | 470 Ω | | 9 Analog | 9 > 1k Ω | 35 > 1k Ω | - | 330 Ω | 100 Ω | 220 Ω | 680 Ω | 470 Ω |
| 10 | 10 | 3 | - | - | - | - | - | - | | 10 Analog | 10 | 32 | - | - | - | - | - | - |
| 11 | 0 | 1 | - | - | - | - | - | P1-2 | | 11 RX | 0 | 3 | - | - | - | - | - | P1-2 |
| 12 | - | 22 | - | - | - | - | - | - | | 12 - | - | - | - | - | - | - | - | - |
| 13 | - | 23 | - | - | - | - | - | - | | 13 - | - | - | - | - | - | - | - | - |
| 14 | 14 | 12 | MISO | - | - | - | - | P2-6* | | 14 MISO | 14 | 12 | MISO | - | - | - | - | P2-6* |
| 15 | 15 | 14 | SCLK | - | - | - | - | P2-9* | | 15 SCLK | 15 | 14 | SCLK | - | - | - | - | P2-9* |
| 16 | 16 | 13 | MOSI | - | - | - | - | - | | 16 MOSI | 16 | 13 | MOSI | - | - | - | - | - |
| 17 | - | 27 | - | - | - | - | - | - | | 17 - | - | - | - | - | - | - | - | - |
| 18 | 18 | 26 | - | DATA1 | - | - | - | P2-1 | | 18 Analog | 18 | 27 | - | DATA1 | - | - | - | P2-1 |
| 19 | 19 | 25 | - | DATA2 | - | - | - | P2-2 | | 19 Analog | 19 | 26 | - | DATA2 | - | - | - | P2-2 |
| 20 | 20 | 33 | - | DATA3 | - | - | - | P2-3 | | 20 Analog | 20 | 25 | - | DATA3 | - | - | - | P2-3 |
| 21 | 21 | 32 | - | DATA4 | - | - | - | P2-4 | | 21 Analog | 21 | 33 | - | DATA4 | - | - | - | P2-4 |
| 22 | - | - | - | - | - | - | - | - | | 22 - | - | - | - | - | - | - | - | - |
| 23 | - | 3.3V VCC | 3.3V VCC | - | - | 3.3V VCC | 3.3V VCC | - | | 23 3.3V VCC | - | 3.3V VCC | 3.3V VCC | - | - | 3.3V VCC | 3.3V VCC | - |
| 24 | 5V VCC OUT | 5V VCC | 5V VCC | 5V VCC | 5V VCC | - | 5V VCC | PX-5 5V VCC | | 24 5V VCC | 5V VCC OUT | 5V VCC | 5V VCC | 5V VCC | 5V VCC | - | 5V VCC | PX-5 5V VCC |
| 25 | GND | GND | GND | GND | - | GND | GND | PX-8 GND | | 25 GND | GND | GND | GND | GND | - | GND | GND | PX-8 GND |
* 2nd player Genesis is incompatible with Radio because it uses the same pins, 1 player Genesis is compatible * 2nd player Genesis is incompatible with Radio because it uses the same pins, 1 player Genesis is compatible
Ω This is optional and only used for dongle detection. For DB-25 pin 9: On the micro, run to pin 9 to 5V VCC with a 1k resistor. On ESP32, run to pin 35 to 3.3V VCC with a 1k resistor. On each dongle, run a resistor of the given value between DB-25 pin 9 and GND. Ω This is optional and only used for dongle detection. On the microcontroller side, put a 1k resistor between DB-25 pin 9 and VCC (3.3v for ESP32, 5V for Micro). On each controller dongle, put a resistor of the given value between DB-25 pin 9 and GND.
All connected pins can also function as Digital pins.
Credits / Links Credits / Links
--------------- ---------------

View File

@ -6,31 +6,24 @@
#if defined(ARDUINO_ARCH_ESP32) #if defined(ARDUINO_ARCH_ESP32)
// esp32 // esp32
#define OR_PIN_1 15 #define OR_PIN_1 1
#define OR_PIN_2 2 #define OR_PIN_2 21
#define OR_PIN_3 4 #define OR_PIN_3 22
#define OR_PIN_4 16 #define OR_PIN_4 15
#define OR_PIN_5 17 #define OR_PIN_5 16
#define OR_PIN_6 5 #define OR_PIN_6 2
#define OR_PIN_7 18 #define OR_PIN_7 17
#define OR_PIN_8 19 #define OR_PIN_8 4
#define OR_PIN_9 35 #define OR_PIN_9 35
#define OR_PIN_10 3 #define OR_PIN_10 32
#define OR_PIN_11 1 #define OR_PIN_11 3
//#define OR_PIN_12 22
//#define OR_PIN_13 23
#define OR_PIN_14 12 #define OR_PIN_14 12
#define OR_PIN_15 14 #define OR_PIN_15 14
#define OR_PIN_16 13 #define OR_PIN_16 13
//#define OR_PIN_17 27 #define OR_PIN_18 27
#define OR_PIN_18 26 #define OR_PIN_19 26
#define OR_PIN_19 25 #define OR_PIN_20 25
#define OR_PIN_20 33 #define OR_PIN_21 33
#define OR_PIN_21 32
//#define OR_PIN_22 22
//#define OR_PIN_23 23
//#define OR_PIN_24 24
//#define OR_PIN_25 25
#else #else
// micro // micro
#define OR_PIN_1 1 #define OR_PIN_1 1
@ -44,20 +37,19 @@
#define OR_PIN_9 9 #define OR_PIN_9 9
#define OR_PIN_10 10 #define OR_PIN_10 10
#define OR_PIN_11 0 #define OR_PIN_11 0
//#define OR_PIN_12 12
//#define OR_PIN_13 13
#define OR_PIN_14 14 #define OR_PIN_14 14
#define OR_PIN_15 15 #define OR_PIN_15 15
#define OR_PIN_16 16 #define OR_PIN_16 16
//#define OR_PIN_17 17
#define OR_PIN_18 18 #define OR_PIN_18 18
#define OR_PIN_19 19 #define OR_PIN_19 19
#define OR_PIN_20 20 #define OR_PIN_20 20
#define OR_PIN_21 21 #define OR_PIN_21 21
//#define OR_PIN_22 22
//#define OR_PIN_23 23
//#define OR_PIN_24 24
//#define OR_PIN_25 25
#endif // ARDUINO_ARCH_ESP32 #endif // ARDUINO_ARCH_ESP32
// currently unused, reserved for future use
//#define OR_PIN_12 -
//#define OR_PIN_13 -
//#define OR_PIN_17 -
//#define OR_PIN_22 -
#endif // OR_PINS_H #endif // OR_PINS_H