Just to be sure that everyone reading this thread is using the same terms and understands what I'm trying to do, here is a glossary and overview.
AVR board - A microcontroller and supporting components (resistors, capacitors, crystal oscillators, etc) mounted on a PCB with solder connection points so you can connect outputs (like 5v for external LEDs) or control inputs. (buttons, analog joysticks, etc.)
An AVR board is a tiny computer that has a microcontroller, a bootloader (like a BIOS) and flash memory. (like the application software on your computer)
Different AVR boards have different microcontroller Input/Output (I/O) pins available to the user. For example, the Arduino Pro Micro and Arduino Micro use the same 32u4 microcontroller, but the Micro board has more I/O pins connected to the microcontroller.
Microcontroller - The processor chip. Here is a list of the relevant ones and which KADE project they are used in.
- AT90USB162 - 16k of flash memory, only has digital I/O pins (not many boards still made using this MCU) miniArcade
- ATMega32u2 - 32k of flash memory, only has digital I/O pins (not many boards still made using this MCU) miniArcade
- ATMega32u4 - has digital and analog I/O pins (many boards are still made using this MCU) KADE+, KADESTICK, miniConsole+
- AT90USB646 - has digital and analog I/O pins (few boards are made using this MCU) maxArcade
- AT90USB1286 - has digital and analog I/O pins (few boards are made using this MCU) maxArcade
Bootloader - Acts like the BIOS in a computer and does two things.
- When the board
is not in programming mode, it runs (boots) the hex firmware loaded into the flash memory.
- When the board
is in programming mode, it loads the hex firmware from a programming application into the flash memory.
There are two main types of bootloaders that we will be working with.
- "CDC" is usually on Arduino boards.
- "Atnel DFU" is usually on other boards.
Some boards can use either bootloader, but may require a "pullup" resistor to keep the board from defaulting into programming mode.
Hex firmware - Like an application program on your computer, this hexadecimal file stored in flash memory tells the microcontroller what to do and when to do it.
KADE Loader - Software that allows you to easily customize and load hex firmwares onto supported AVR boards.
The most common AVR boards that Loader recognizes and supports are the Minimus AT90USB162 and the Minimus ATMega32u2. (miniArcade)
When the board is in programming mode, KADE Loader can command the bootloader to program a hex firmware into the board's flash memory.
Different bootloaders require different commands/procedures to do this.
Hex firmwares may work with some microcontrollers, but not with others -- for example, when Loader compiles/loads miniArcade firmwares, it uses commands and programming registers for the AT90USB162 microcontroller that also work with the ATMega32u2.
This works because the 32u2 is retro-compatible with AT90USB162 hex firmware commands/registers.
I don't remember the source for the sub-quote, but it appears that the 32u4 is retro-compatible with KADE miniArcade firmwares
and that they should work with the Pro Micro.
Either use a Minimus AVR and the KADE firmware or Degenatrons mentioned that if you recompile the KADE source code for ATMega32u4, you can use this chinese board (looks like an inexpensive knockoff of the Sparkfun Pro Micro) since,
atmega32u4 IC is entirely compatible with the previous KADE firmwares whilst providing more pins + analog.
OBJECTIVES:What I will not do: The Loader source code looks WAY more complicated/finnicky than the firmwares, so I will leave that to Code Monkeys that are much further evolved than this lowly Code Paramecium.
As I mentioned in the OP, here's what I'm trying to do with the KADE
firmware source code:
I'm just trying to use the firmwares on different AVRs and maybe modify the source code so I can compile custom firmwares to work with them.
Right now, I'd be happy to figure out three things:
1. If the 32u4 is retro-compatible with 32u2 firmwares, which pin on the 32u2 corresponds to which pin on the 32u4?
I can probably find the answer using a gamepad hex and probing each pin on the Arduino Pro Micro. 
2. What source code file(s)/variable(s) to edit in order to assign which pin on the AVR handles an input.
i.e. Move KADESTICK firmware Button 1 from 32u4 pin 8 whch is only connected to an LED on the Pro Micro to 32u4 pin 31, an available digital input pin.
3. What source code file(s)/variable(s) to edit in order to change the keystroke for a given input.
i.e. Changing P1B1 from "CTRL" to something else.
Logical next step: Recompile a firmware for use on a 32u4 board.1. Edit the MiniArcade MAME firmware's "Makefile".
- Change target to "KADE-MAME_32u4". (hex file filename)
- Change MCU to atmega32u4. (need to verify)
# Target file name (without extension).
TARGET = KADE-MAME
# List C source files here. (C dependencies are automatically generated.)
SRC = main.c usb_keyboard.c
# MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt
#
# NOTE - Stuff compiled for 16k will work on both!!
MCU = at90usb162 # Minimus AVR 16K
#MCU = atmega32u2 # Minimus AVR 32k
2. Use the procedures outlined in
this post to compile the source into a hex firmware file.
3. Load the firmware on a Pro Micro board.
4. Probe the pins and document what comes up on the keyboard tester utilty.
Scott
Note to self:
Original KADESTICK thread where the firmwares were developed.
(You must be a member of that private sub-forum to view the thread, so don't bother clicking on the link.)