pascalh 34 Report post Posted April 22, 2014 (edited) A few weeks ago my son switched from his old G25 wheel/shifter combo to a brand new Thrustmaster TX + F1 addon wheel. In the process he lost the G25 shifter that he used mainly for Nascar and MX5 racing. To get a working shifter, there were several choices: Buying a new shifter: obvious but expensive Use the G25 shifter connected to the wheel without using the wheel: inelegant! Buying a Leo Bodnar interface (http://www.leobodnar.com/shop/index.php?main_page=product_info&cPath=72&products_id=188): cheap and easy Build our own interface: even cheaper and more versatile We chose the latter option to have the best possible control on the gear shifting logic: the stock G25 shifting logic is somewhat buggy, leading to quite frequent mis-shifts. Having full control of the software also allows adding some new functions: a handbrake mode seems the most obvious as the G25 shifter has all the necessary hardware. In the following posts I will explain all the steps required to build a G25 shifter to USB interface, based on a Teensy 2.0 board. This writeup is split into 5 chapters, each chapter being one post: Chapter 1: Hardware and tools required Chapter 2: Wiring and canning Chapter 3: Software Chapter 4: Tests and configuration Chapter 5: Conclusion Edited June 22, 2016 by pascalh 1 Regis Souza reacted to this Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 22, 2014 (edited) Chapter 1: Hardware and tools required 1. Hardware 1 G25 shifter (obviously ) 1 Teensy 2.0 http://pjrc.com/store/teensy.html The Teensy 2.0 board is incredibly powerful given the small form factor at 18 x 30mm. It easily emulates any USB HID device. It take its power supply from the USB wire, minimizing the wiring 1 DB9 connector http://www.conrad-electronic.co.uk/ce/en/product/742066/D-Sub-With-Solder-Cup-Number-of-pins-9-Plug-straight-Soldering?ref=searchDetail 7 wires http://www.ebay.com/itm/50pcs-1007-24-color-PCB-Solder-Cable-10cm-Fly-Jumper-Wire-Cable-/271251127947?pt=LH_DefaultDomain_0&hash=item3f27d3be8b 1 small box I took a small RS component box, but the Teensy 2.0 being so small at 30 x 18mm it could be much smaller. Any plastic box will do as long as the height is larger than the SUB-D 9 connector at 13mm 2 3mm bolts and nuts. 10mm length is enough Double sided tape 2. Tools Set of Philips screwdrivers Small cutting pliers Cutter knife Dremel with 3mm milling tool and 3mm drilling bit Soldering station Back to Table of Content Edited June 22, 2016 by pascalh 1 Regis Souza reacted to this Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 22, 2014 (edited) Chapter 2: Wiring and canning Operation of the G25 shifter The inner electronics of the G25 shifter is very simple: all the buttons are connected to digital inputs and surprisingly the shifter position is recorded by 2 potentiometers for X and Y axis. The X axis records the left/right travel of the shifter and the Y axis records the front/rear travel. Both X and Y axis voltages are directly available on the connector. The digital signals are not directly routed to the SUBD9 connector: they are all connected to a set of two 8 bit shift registers. From a maximum 16 inputs only 14 are connected. The master controller provides parallel/serial and clock signal to shift out each bit on the Q8 wire. Both shift registers are cascaded through the Serial In input. Power supply is provided by the host controller through the SUBD9 connector. SUBD9 connector pinout (G25 shifter point of view): pin 1: Power supply Vcc pin 2: Output Data pin 3: Input Parallel/serial pin 4: Output X axis pin 5: Not connected pin 6: Power supply GND pin 7: Input Clock pin 8: Output Y axis pin 9: Not connected Digital inputs: REV: reverse switch, gear shift pressed down MODE: sequential/H-pattern mode, on when in sequential mode RED_CR: center right red button RED_CL: center left red button RED_R: rightmost red button RED_L: leftmost red button BL_T: topmost black button BL_R: rightmost black button BL_L: leftmost black button BL_B: bottom black button DP_R: d-pad right DP_L: d-pad left DP_B: d-pad bottom DP_T: d-pad top Schematics of G25 Shifter Wiring The inputs and outputs of the G25 shifter at the SUBD9 connector are composed of output voltages, digital inputs and digital outputs. These input and output types are readily available on the Teensy solder pads. Therefore there is no need for additional electronic circuitry for shifting of converting voltage levels: shifter and Teensy can be connected with simple wires The Teensy is powered by the PC through the USB connector. Vcc and GND of the Teensy board are routed to the Vcc and GND of the G25 shifter to suplly it with power. A0 and A1 are used as analog input pins for both shifter X and Y axis. A2, A3 and A4 are used to read the digital bits out of the shifter's registers. Teensy 2.0 pinout G25 SUBD9 connector to Teensy 2.0 schematics SUBD9 Direction Teensy Name ----- --------- ------ ---- 1 ----- 7 Vcc 2 ----> 17 Data 3 <---- 18 P/S 4 ----> 21 X axis 5 6 ----- 11 GND 7 <---- 19 Clock 8 ----> 20 Y axis 9 G25 SUBD9 connector to Teensy 2.0 wiring: only 7 wires are needed to connect the SUBD9 connector to the Teensy 2.0 board. Wiring is easy as all the connections on the Teensy side are through-hole solder pads. Be sure to use a SUBD9 connector with solder cup pins for easy wiring Canning Choose a small plastic box. Minimum height is 13mm to accomodate the SUBD9 connector (see specifications below). Cut out the D shaped connector front out of the plastic box with a Dremel milling tool. Mount the SUBD connector from inside the box. Drill 3mm hole to fasten the connector to the box with 2 3mm bolts and nuts Place the Teensy board inside of the box, USB connector facing one wall. Mark the USB connector on the plastic wall. Cut out an opening to accomodate the USB male connector through the wall. Use thick double-sided tape to fasten the Teensy board to the bottom of the plastic box The interface can now be connected to the PC with an USB cable on one side and to the G25 with the SUBD9 connector on the other side Back to Table of Content Edited June 22, 2016 by pascalh 1 Regis Souza reacted to this Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 22, 2014 (edited) Chapter 3: Software 1. Software environment While being very small, the Teensy 2.0 board has a broad software environment. There are several plugins for Eclipse and Visual Studio, but the most effective way to program the Teensy board for small projects is using the Arduino software environment. To set up this software environment for Teensy, the Arduino software has to be installed first. Then the Teensyduino software which adds many libraries and Teensy capabilities to the Arduino software has to be installed Arduino Software Download the Arduino software environment from http://arduino.cc/en/Main/Software, then install it. Be sure to take version 1.0.5 as the newer beta versions are not compatible with Teensyduino Teensyduino Download Teensyduino from http://pjrc.com/teensy/td_download.html, then install it following the instructions given on the same page. The latest Teensyduino software package tested to work with the program below is version 1.18. The Teensyduino installer will install a virtual serial port which is very useful for debugging. Sometimes the virtual serial port device driver won't install properly when virus protection software is running. You can safely disable it during the install procedure 2. G25 shifter program Connect your Teensy 2.0 board to your PC with an USB cable Run the Arduino software In the "Tools" menu, select the "Teensy 2.0" board In the "Tools" menu, select the "USB type" as "Keyboard + Mouse + Joystick" Load the "G25_shifter_en.ino" file attached at the end of this post, or alternatively open a new sketch and paste the program listing given below into the editor window // // G25 shifter to USB interface // based on a Teensy 2.0 // // 3 operating modes // - H-pattern shifter // - Sequential shifter // - Analog handrake // // // G25 shifter pinout // // DB9 Color Shifter Description Teensy // 1 Black 1 +5V +5V // 2 Grey 7 Button Data pin 17 // 3 Yellow 5 Button !CS & !PL pin 18 // 4 Orange 3 Shifter X axis pin 21 (A0) // 5 Red 2 SPI input // 6 White 8 GND GND // 7 Purple 6 Button Clock pin 19 // 8 Green 4 Shifter Y axis pin 20 (A1) // 9 Black 1 +5V // Teensy pin definitions #define LED_PIN 11 #define DATA_IN_PIN 17 #define MODE_PIN 18 #define CLOCK_PIN 19 #define X_AXIS_PIN 20 #define Y_AXIS_PIN 21 // H-shifter mode analog axis thresholds #define HS_XAXIS_12 400 #define HS_XAXIS_56 600 #define HS_YAXIS_135 800 #define HS_YAXIS_246 300 // Sequential shifter mode analog axis thresholds #define SS_UPSHIFT_BEGIN 670 #define SS_UPSHIFT_END 600 #define SS_DOWNSHIFT_BEGIN 430 #define SS_DOWNSHIFT_END 500 // Handbrake mode analog axis limits #define HB_MAXIMUM 530 #define HB_MINIMUM 400 #define HB_RANGE (HB_MAXIMUM-HB_MINIMUM) // Digital inputs definitions #define DI_REVERSE 1 #define DI_MODE 3 #define DI_RED_CENTERRIGHT 4 #define DI_RED_CENTERLEFT 5 #define DI_RED_RIGHT 6 #define DI_RED_LEFT 7 #define DI_BLACK_TOP 8 #define DI_BLACK_RIGHT 9 #define DI_BLACK_LEFT 10 #define DI_BLACK_BOTTOM 11 #define DI_DPAD_RIGHT 12 #define DI_DPAD_LEFT 13 #define DI_DPAD_BOTTOM 14 #define DI_DPAD_TOP 15 // Shifter state #define DOWN_SHIFT -1 #define NO_SHIFT 0 #define UP_SHIFT 1 // Shifter mode #define SHIFTER_MODE 0 #define HANDBRAKE_MODE 1 // LED blink counter int led=0; // Shifter state int shift=NO_SHIFT; // Handbrake mode int mode=SHIFTER_MODE; // Called at startup // Must initialize hardware and software modules void setup() { // G25 shifter analog inputs configuration pinMode(X_AXIS_PIN, INPUT_PULLUP); // X axis pinMode(Y_AXIS_PIN, INPUT_PULLUP); // Y axis // G25 shift register interface configuration pinMode(DATA_IN_PIN, INPUT); // Data in pinMode(MODE_PIN, OUTPUT); // Parallel/serial mode pinMode(CLOCK_PIN, OUTPUT); // Clock // LED output mode configuration pinMode(LED_PIN, OUTPUT); // LED // Virtual joystick configuration Joystick.useManualSend(true); // Joystick output is synchronized // Virtual serial interface configuration Serial.begin(38400); // Virtual joystick initialization Joystick.X(0); Joystick.Y(0); Joystick.Z(0); Joystick.Zrotate(0); Joystick.sliderLeft(0); Joystick.sliderRight(0); // Digital outputs initialization digitalWrite(LED_PIN, LOW); digitalWrite(MODE_PIN, HIGH); digitalWrite(CLOCK_PIN, HIGH); } // Called in a loop after initialization void loop() { // Reading of button states from G25 shift register int b[16]; digitalWrite(MODE_PIN, LOW); // Parallel mode: inputs are read into shift register delayMicroseconds(10); // Wait for signal to settle digitalWrite(MODE_PIN, HIGH); // Serial mode: data bits are output on clock falling edge for(int i=0; i<16; i++) // Iteration over both 8 bit registers { digitalWrite(CLOCK_PIN, LOW); // Generate clock falling edge delayMicroseconds(10); // Wait for signal to settle b[i]=digitalRead(DATA_IN_PIN); // Read data bit and store it into bit array digitalWrite(CLOCK_PIN, HIGH); // Generate clock rising edge delayMicroseconds(10); // Wait for signal to settle } // Reading of shifter position int x=analogRead(0); // X axis int y=analogRead(1); // Y axis // Handbrake mode logic if(b[DI_RED_CENTERLEFT]!=0) // Is left center red button depressed? { if(b[DI_RED_CENTERRIGHT]!=0) // Is right center red button also depressed? { if(b[DI_RED_RIGHT]!=0) // Is rightmost red button also depressed? { mode=HANDBRAKE_MODE; // Handbrake mode is activated if the 3 rightmost } // red buttons are depressed if(b[DI_RED_LEFT]!=0) // Is leftmost red button also depressed? { mode=SHIFTER_MODE; // Handbrake mode is deactivated if the 3 leftmost } // red buttons are depressed } } // Current gear calculation int gear=0; // Default value is neutral if(b[DI_MODE]==0) // H-shifter mode? { if(x<HS_XAXIS_12) // Shifter on the left? { if(y>HS_YAXIS_135) gear=1; // 1st gear if(y<HS_YAXIS_246) gear=2; // 2nd gear } else if(x>HS_XAXIS_56) // Shifter on the right? { if(y>HS_YAXIS_135) gear=5; // 5th gear if(y<HS_YAXIS_246) gear=6; // 6th gear } else // Shifter is in the middle { if(y>HS_YAXIS_135) gear=3; // 3rd gear if(y<HS_YAXIS_246) gear=4; // 4th gear } } else // Sequential mode { if(mode==SHIFTER_MODE) // Shifter mode? { Joystick.X(0); if(shift==NO_SHIFT) // Current state: no shift { if(y>SS_UPSHIFT_BEGIN) // Shifter to the front? { gear=1; // Shift-up shift=UP_SHIFT; // New state: up-shift } if(y<SS_DOWNSHIFT_BEGIN) // Shifter to the rear? { gear=2; // Shift-down shift=DOWN_SHIFT; // New state: down-shift } } if(shift==UP_SHIFT) // Current state: up-shift? { if(y>SS_UPSHIFT_END) gear=1; // Beyond lower up-shift threshold: up-shift else shift=NO_SHIFT; // Else new state: no shift } if(shift==DOWN_SHIFT) // Current state: down-shift { if(y<SS_DOWNSHIFT_END) gear=2; // Below higher down-shift threshold: down-shift else shift=0; // Else new state: no shift } } else // Handbrake mode { if(y<HB_MINIMUM) y=HB_MINIMUM; // Clip minimum position if(y>HB_MAXIMUM) y=HB_MAXIMUM; // Clip maximum position long offset=(long)y-HB_MINIMUM; y=(int)(offset*1023/HB_RANGE); // Scale input between minimum and maximum clip position Joystick.X(y); // Set handbrake analog output gear=0; // No gear engaged: neutral } } if(gear!=6) b[DI_REVERSE]=0; // Reverse gear is allowed only on 6th gear position if(b[DI_REVERSE]==1) gear=0; // 6th gear is deactivated if reverse gear is engaged // Release virtual buttons for all gears Joystick.button(1, LOW); Joystick.button(2, LOW); Joystick.button(3, LOW); Joystick.button(4, LOW); Joystick.button(5, LOW); Joystick.button(6, LOW); // Depress virtual button for current gear if(gear>0) Joystick.button(gear, HIGH); // Set state of virtual buttons for all the physical buttons (including reverse) for(int i=0; i<16; i++) Joystick.button(7+i, b[i]); // Write new virtual joystick state Joystick.send_now(); // Write inputs and outputs (remove comments to debug) /* Serial.print(" X axis: "); Serial.print(x); Serial.print(" Y axis: "); Serial.print(y); Serial.print(" Digital inputs: "); for(int i=0; i<16; i++)Serial.print(b[i]); Serial.print(" "); Serial.print(" Gear: "); Serial.print(gear); Serial.print(" Mode: "); Serial.print(mode); Serial.print(" Shift: "); Serial.println(shift); */ // Blink the on-board LED if(++led==100) led=0; // Period is 100 cycles * 10ms = 1s if(led==0) digitalWrite(LED_PIN, LOW); // LED is off for 50 cycles if(led==50) digitalWrite(LED_PIN, HIGH); // LED is on for 50 cycles // Wait delay(10); // Wait for 10ms } Click on the right arrow button to compile the program and to flash the Teensy board. The size of the flash memory and RAM used should be displayed. If there are any compile errors, be sure to have selected "Teensy 2.0" and "Keyboard + Mouse + Joystick" in the steps above After compiling, the Teensy loader should be displayed and the Arduino console will ask you to press the Reset button on the Teensy board. After pressing the small black Reset button, the program is tranfered to the Teensy board and flashed The Teensy board will then reboot and happily start blinking at 1Hz. Windows will then discover a new HID device and install the appropriate drivers Back to Table of Content G25_shifter_en.zip Edited June 22, 2016 by pascalh 1 Regis Souza reacted to this Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 22, 2014 (edited) Chapter 4: Tests and configuration 1. Tests The first and easiest test consists in checking that the LED next to the Teensy reset button is blinking. It should blink at a 1hz frequency: 0.5s on and 0.5s off. If it blinks, the program has been compiled and flashed without error The second step consists in checking that Windows sees the Teensy as a USB HID device. Open the game controller control panel: in the search bar above the windows start button orb type "joy.cpl" then enter. The following panel should open: One of the controllers should be named "Keyboard/Mouse/Joystick". This is the Teensy board acting as a game controller. If this is not the case, either the Teensy board is not running the program (see above) or the connection to the PC is faulty. Check with another USB cable on another USB port The final step consists in checking all the inputs. In the game controller control panel select the "Keyboard/Mouse/Joystick" controller, then click the "Properties" button. The game controller properties windows should open. Then click the "Test" tab of the joystick test panel: After connecting the G25 shifter to the interface, select the H-pattern shifter mode on the shifter: the green LED on the shifter should be off. Then select each gear on the shifter. The following virtual buttons should be active on the test panel: Gear 1: button 1 Gear 2: button 2 Gear 3: button 3 Gear 4: button 4 Gear 5: button 5 Gear 6: button 6 Reverse: button 8 Select the Sequential mode on the shifter: the green LED should be on. On the test panel button 10 should be on. Push the shifter to the front: button 1 should be on Pull the shifter to the rear: button 2 should be on Press each button and d-pad. The following virtual buttons should be active on the test panel: Left red button: button 14 Center left red button: button 12 Center right red button: button 11 Right red button: button 13 Topmost black button: button 15 Leftmost black button: button 17 Rightmost black button: button 16 Bottommost black button: button 18 D-pad up: button 22 D-pad left: button 20 D-pad right: button 19 D-pad down: button 21 The last test is for the hanbrake mode. While in Sequential mode, press the 3 leftmost red buttons simultaneously to switch to handbrake mode. When pulling the gear shifter, the small cross in the "X axis/Y axis" panel should move from right to left If any of these steps is not successful jump to the "advanced tests" section. If all the tests succeded, you're set 2. Advanced tests If the Teensy board is detected as a USB HID device but the gear selection on the G25 shifter doesn't appear as button presses, this is likely due to a wrong wiring of the analog inputs. This can be easily checked by using the debug mode: First uncomment the block of debug print statements in the code Recompile and flash the Teensy board Open the Serial Monitor in the Arduino programming environment The following Serial Monitor window should open The inner X and Y axis values are displayed. When moving the gear shifter to left or to right, the X axis should change, when moving to front or to rear, the Y axis should change. The Gear parameter displays the currently engaged gear. If one of the axis doesn't move, check the corresponding wiring (pin 20, 21) It could also happen that the axis doesn't move enough to cross the thresholds. I defined the X and Y thresholds for each gear based on the readings from my 2 G25 shifters. If your shifter is very different from mine, you could have to change the calibration: see the configuration section If the Teensy board is detected as a USB HID device but the button pressed on the shifter don't appear on the test panel check the digital inputs in the Serial Monitor. If nothing changes as you press buttons, check the corresponding wiring (pin 17, 18, 19) There is no calibration for the buttons as these are digital inputs 3. Configuration If the X and Y axis values are changing according to gear shifter input but some or all of the gear wouldn't engage, you have to check the X and Y axis values against their respective thresholds in the source code (see below) When The gear shifter is in gear 1 and 2, X axis should be lower than HS_XAXIS12. If not increase HS_XAXIS12 When The gear shifter is in gear 5 and 6, X axis should be higher than HS_XAXIS56. If not decrease HS_XAXIS56 When The gear shifter is in gear 1, 3 or 5, Y axis should be higher than HS_YAXIS135. If not decrease HS_XAXIS135 When The gear shifter is in gear 2, 4 or 6, Y axis should be lower than HS_YAXIS246. If not increase HS_XAXIS246 #define HS_XAXIS_12 400 #define HS_XAXIS_56 600 #define HS_YAXIS_135 800 #define HS_YAXIS_246 300 Back to Table of Content Edited June 22, 2016 by pascalh 1 Regis Souza reacted to this Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 22, 2014 Chapter 5: Conclusion 1. Cost The cost of a Teensy 2.0 being only $16 and the connnector, box and wires costing about nothing, I would estimate the total cost at less than $20. This is very cheap given the features that can be packed into the Teensy board and the room for future expansion 2. Time The fabrication and wiring took less than one hour Planning, documenting and writing the software took several hours, but this should not be a concern as I give it away 3. Final thoughts Thanks to this incredible powerful piece of embedded electronics the Teensy 2.0 is, it was very easy to build this interface in only few hours Compared to other available solutions, it offers the benefit of being expandable with new functions programmed as needed The next step would be to add buttons and quadrature encoders to this interface box, with some cool selection logic you can't get with any commercial button box Back to Table of Content 1 Regis Souza reacted to this Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 22, 2014 Looks cool, I will keep an eye on your thread, cheers, AussieStig Thanks Chapter 1 is completed Pictures for chapter 2 are already uploaded. Should be finished this evening Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 22, 2014 Chapter 2 has been completed Chapter 3 is on the way Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 23, 2014 Chapter 3 has been completed Chapter 4 is on the way Share this post Link to post Share on other sites
xxValiumxx 0 Report post Posted April 24, 2014 pascalh, I was quite literally doing exactly this (Except for a G27) when I came across this thread. I like your code better. Obviously there will be changes for the G27, and if you would like, I'll post those here. I'll be adding other bits to my code as well (OutSim/OutGuage stuff), if you're interested. Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 25, 2014 (edited) On 24/04/2014 at 9:37 PM, xxValiumxx said: pascalh, I was quite literally doing exactly this (Except for a G27) when I came across this thread. I like your code better. Obviously there will be changes for the G27, and if you would like, I'll post those here. I'll be adding other bits to my code as well (OutSim/OutGuage stuff), if you're interested. Great Are the G25 and G27 shifter pinouts the same? I would be glad to see the changes for the G27 I was planning to write a second part, where I would add additional buttons and encoders as there are many inputs left unused in the current design. The corresponding software would be really straigthforward Edited June 22, 2016 by pascalh Share this post Link to post Share on other sites
xxValiumxx 0 Report post Posted April 25, 2014 Great Are the G25 and G27 shifter pinouts the same? I would be glad to see the changes for the G27 I was planning to write a second part, where I would add additional buttons and encoders as there are many inputs left unused in the current design. The corresponding software would be really straigthforward Actually, no, they are not. the +5v (DSUB 1) and Clock (DSUB 7) pins are swapped. I have the code completed, but I did have to remove the sequential and handbrake sections of code, as the G27 shifter has no sequential feature (meaning no handbrake either). I just have to wait for the mail to get here tomorrow and then I will be able to verify my code. I plan on ordering a set of G27 pedals as well and adding code for those. I'm using the Teensy++ 2.0 so I have 128k of program and 8 K of ram to play with, and currently I'm using 5,174 Bytes (5k) of program and a mere 131 bytes of ram. Plenty of room left to play. Good job on knowing how to use defines, many people still don't use them for pin definitions. Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 25, 2014 (edited) On 25/04/2014 at 10:36 AM, xxValiumxx said: Actually, no, they are not. the +5v (DSUB 1) and Clock (DSUB 7) pins are swapped. I have the code completed, but I did have to remove the sequential and handbrake sections of code, as the G27 shifter has no sequential feature (meaning no handbrake either). I just have to wait for the mail to get here tomorrow and then I will be able to verify my code. I plan on ordering a set of G27 pedals as well and adding code for those. I'm using the Teensy++ 2.0 so I have 128k of program and 8 K of ram to play with, and currently I'm using 5,174 Bytes (5k) of program and a mere 131 bytes of ram. Plenty of room left to play. Good job on knowing how to use defines, many people still don't use them for pin definitions. Didn't know the pinout was different with 2 pins swapped. What a lousy design change from Logitech. Seems they didn't want users to swap G25 and G27 devices . At least swapping devices won't break anything as both are inputs. Too bad one changed pin is +5, otherwise a detection algorithm could have been a good idea G27 pedals are quite easy to interface as it's merrily reading 3 potentiometers, then scaling and writing to a joystick virtual axis With your Teensy++ 2.0 you will have many inputs/outputs left to play with. 20 buttons or 10 encoders easily , with full HID plug and play. Using it for outputs is more tricky, as you need some kind of PC side software in addition to a new HID descriptor Using defines is a good idea for pin definitions, as pinout changes are only affected in one place in the software. Same for software thresholds: I will cover this in chapter 5 Edited June 22, 2016 by pascalh Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 25, 2014 Chapter 4 and 5 have been completed Write-up is complete Share this post Link to post Share on other sites
xxValiumxx 0 Report post Posted April 26, 2014 Confirmed working with G27 shifter. Modified sketch included. G27_shifter_en.zip Share this post Link to post Share on other sites
pascalh 34 Report post Posted April 26, 2014 (edited) On 26/04/2014 at 3:21 AM, xxValiumxx said: Confirmed working with G27 shifter. Modified sketch included. Great! Edited June 22, 2016 by pascalh Share this post Link to post Share on other sites
williampp 0 Report post Posted August 3, 2014 pascalh thanks for sharing your idea! can make for a nano arduino uno or leonardo? teensy for me because it is very hard to got and own an Arduino Nano V3 artmega328 Share this post Link to post Share on other sites
pascalh 34 Report post Posted August 6, 2014 (edited) williampp, it could be done with an arduino uno or nano but it's much more difficult as you have to flash a different bootloader to make it look like a joystick. The leonardo code should be almost the same as the teensy code. But honestly, why bother with anything else than a teensy: it's small, fast, inexpensive and is supported in hardware and software by PJRC (see www.pjrc.com) Edited June 22, 2016 by pascalh Share this post Link to post Share on other sites
montitotal 1 Report post Posted November 28, 2014 Actually, no, they are not. the +5v (DSUB 1) and Clock (DSUB 7) pins are swapped. I have the code completed, but I did have to remove the sequential and handbrake sections of code, as the G27 shifter has no sequential feature (meaning no handbrake either). I just have to wait for the mail to get here tomorrow and then I will be able to verify my code. I plan on ordering a set of G27 pedals as well and adding code for those. I'm using the Teensy++ 2.0 so I have 128k of program and 8 K of ram to play with, and currently I'm using 5,174 Bytes (5k) of program and a mere 131 bytes of ram. Plenty of room left to play. Good job on knowing how to use defines, many people still don't use them for pin definitions. Hi everyone, I am working to clone the G27 shifter board to integrate a new PCB in a DIY F1 wheel. I do not know how the SUBD9 connector pinout is, but modifying the diagram provided by pascalh as xxValiumxx said, I get: pin 1: Input <- Clock pin 2: Output -> Serial Data pin 3: Input <- Parallel/Serial (!CS) pin 4: Output -> X axis pin 5: pin 6: Power Supply GND pin 7: Power Supply Vcc pin 8: Output -> Y axis pin 9: Could anybody confirm whether cable colors are also swapped? Then it should be right as follow: 1---Violet 2---Grey 3---Yellow 4---Orange 5---Red 6---White 7---Black 8---Green 9---Black Thanks anyway! Share this post Link to post Share on other sites
pascalh 34 Report post Posted December 3, 2014 (edited) On 28/11/2014 at 1:43 PM, montitotal said: Hi everyone, I am working to clone the G27 shifter board to integrate a new PCB in a DIY F1 wheel. I do not know how the SUBD9 connector pinout is, but modifying the diagram provided by pascalh as xxValiumxx said, I get: pin 1: Input <- Clock pin 2: Output -> Serial Data pin 3: Input <- Parallel/Serial (!CS) pin 4: Output -> X axis pin 5: pin 6: Power Supply GND pin 7: Power Supply Vcc pin 8: Output -> Y axis pin 9: Could anybody confirm whether cable colors are also swapped? Then it should be right as follow: 1---Violet 2---Grey 3---Yellow 4---Orange 5---Red 6---White 7---Black 8---Green 9---Black Thanks anyway! Can't help much here as I don't own a G27 You could try to send xxValiumxx a PM. He is also known as JPlays on Twitch (http://www.twitch.tv/jplays). Edited June 22, 2016 by pascalh Share this post Link to post Share on other sites
montitotal 1 Report post Posted December 16, 2014 Your schema is correct pascalh, there is no swap. Thank you!! 1 pascalh reacted to this Share this post Link to post Share on other sites
pascalh 34 Report post Posted December 16, 2014 (edited) On 16/12/2014 at 2:14 PM, montitotal said: Your schema is correct pascalh, there is no swap. Thank you!! You're welcome Edited June 22, 2016 by pascalh Share this post Link to post Share on other sites
eforer 9 Report post Posted January 25, 2015 Thanks for the great tutorial. Just completed mine and it works great. Had to tweak some of the values, but easy as pie! Well documented and commented code and well thought out! My TH8RS shifter bit the dust and I've had my G25 sitting on the floor behind me so I can use it's shifter. This let me get rid of that and have a nice tidy setup again. Still miss my TH8 though GREAT WORK!!! Share this post Link to post Share on other sites
pascalh 34 Report post Posted January 25, 2015 (edited) On 25/01/2015 at 1:42 AM, eforer said: Thanks for the great tutorial. Just completed mine and it works great. Had to tweak some of the values, but easy as pie! Well documented and commented code and well thought out! My TH8RS shifter bit the dust and I've had my G25 sitting on the floor behind me so I can use it's shifter. This let me get rid of that and have a nice tidy setup again. Still miss my TH8 though GREAT WORK!!! Thank you, much appreciated Edited June 22, 2016 by pascalh Share this post Link to post Share on other sites
xxValiumxx 0 Report post Posted January 28, 2015 Can't help much here as I don't own a G27 You could try to send xxValiumxx a PM. He is also known as JPlays on Twitch (http://www.twitch.tv/jplays). LIES! Who is JPlays? I assure you, that's not me. I'm glad people are finding this to have some use. I just modified the shifter itself to have 2 extra buttons. In theory, I'm sure 3 are possible, but I didn't bother/couldn't find the correct point to attach a third. https://poweredbyredstone.com/shifter-upgrades/ Share this post Link to post Share on other sites