M-Audio Keystation 61es Replacement PCB
Current BETA version 0.2 - 28-April-2019
Based on Midikey61 project from KodyLabs, modified by Agent24


Firmware for Atmega16U2 is provided with the default hiduino project hex file (arduino_midi.hex). This can be programmed with avrdude over ICSP header. Make sure you set the fuses correctly.
eg: sudo avrdude -p atmega16u2 -F -c stk200 -U flash:w:arduino_midi.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

You can program the Atmega328P with Aruduino bootloader and set fuses if you wish (the firmware is included with the Arduino software package - you have to get that yourself)
eg: sudo avrdude -p m328p -c stk200 -U flash:w:optiboot_atmega328.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD8:m -U efuse:w:0xFC:m -U lock:w:0xFF:m


KiCad project files are included. Should work with v4 or above. Note that INSULATED wirelinks are used in some places, and are NOT part of a top layer.
If you try to fabricate the board as double-sided at a board house, you WILL get shorts. this is for DIY!

The PCB layout could definitely be optimised. It is electrically functional, but not mechanically. The clearance for the control input headers are very tight, but they work.
A complete respin of the board as a true 2-layer design would likely be a smart move. However, I am unlikely to ever do this.


The Arduino code has some support files which need to be copied to your Arduino libraries folder or it will not compile.



ISSUES:

NO support for LEDs of the Keystation 61es. They should be possible by adding a 74HC595 or similar AND multiplexing the 3 button inputs into 2 pins with a 74HC153 or similar.
This will free up enough pins on the Atmega328P. There are probably other ways of doing this too. In all cases the code will need to be changed.


The current Arduimo code is not complete. There is no support for the 3rd button (Advanced Function) at this time. You would need to add your own code to make it do anything.
This will be updated when I get around to it.


There is hardware support in the schematic to send received MIDI messages from the USB port INTO the Atmega328P, but there is no software support.
It is also not added in the PCB.You would need to add this yourself.

You would also need to change the hardware to allow for MIDI messages to be routed from the USB port to the MIDI OUT port, creating a virtual "MIDI THRU"?
There is no support for MIDI IN as two DIN jacks would be needed.