Ok, here's a summary of the changes I made to produce a custom xbox firmware for running on the Arduino Micro (atmega32u4).
Note that my pinout image is different than that in the BYOAC XboxPadMicro thread. The pins PF3 and PF2 on the XboxPadMicro image are actually PF1 and PF0 respectively on my Micro.
Also the pins PD3 and PD2 on the XboxPadMicro image are transposed on my Micro. Looking at the source code Bruno has on github for the XboxPadMicro, it appears he is actually using the pinouts as per this image here, matching the Micro I have here.
So I'm not sure if there are variants of the Micro out there which have these differences. So if anyone uses this firmware and finds that the connections to these pins don't appear to be behaving properly, it might be due to this.
Also note that I had to skip using PC6 as on my Micro it appears connected in some way to PC7. Whenever I grounded either of these pins, both PC6 and PC7 together would go low - weird. This also happened when running the XboxPadMicro firmware, so it looks like it's my board.
With the Minicade 2.0 being developed, and with the XboxPadMicro firmware being available, it may be that no-one has the need for this Kade xbox firmware but I'll post the details and hex anyway, should anyone want to try it.
Redefine AVR Ports in use.
state.c - current state of each pin is read.
outputs.c and showleds.c - used if using an led to denote shift function/power. Not used in this configuration
Redefine configuration of AVR pins to xbox functions.
Rather than reading in configuration from first 69 bytes (using read_eeprom_byte), hardcode functions required into ass() array.
For e.g. if you want DPad Up for kad pin A1 (PC7 in this configuration), see ass(0) to the code 1 - see list below.
/* Function codes for xbox
1 Dpad Up
2 Dpad Down
3 Dpad Left
4 Dpad Right
5 A Button
6 B Button
7 X Button
8 Y Button
9 Left Trigger
10 Right Trigger
15 Left Thumb
16 Right Thumb
17 L/Analog Up
18 L/Analog Down
19 L/Analog Left
20 L/Analog Right
21 R/Analog Up
22 R/Analog Down
23 R/Analog Left
24 R/Analog Right
25 Exit Game
26 Exit to Dashboard- (Combination of Left Trigger, Right Trigger, Back and Black)
27 Invert Analog Y Axis
28 Dpad Restrict 4-Way
29 Dpad Restrict 2-Way X
30 External Shift LED*
31 External +V power*
32 Dpad Restrict 2-Way Y
33 Auto Fire - A Button
34 Auto Fire - B Button
35 Auto Fire - X Button
36 Auto Fire - Y Button
Modify bootloader start address for atmega32u4
#define BOOTLOADER_START_ADDRESS 0x3800
main.c - Add in setup of ports E and F (copy setup of ports B, C and D)
MCU = atmega32u4
ARCH = AVR8
BOARD = LEONARDO
(Just tried adding the hex as an attachment but it won't let me use that extension - if anyone wants it, let me know)
Edit: Now attached as a zip file.
- (5.31 KiB) Downloaded 16 times
Last edited by johnnygal
on Sun Feb 26, 2017 7:41 pm, edited 1 time in total.