PROGRAMMING GUIDE(for Windows)
Step 1:
Download Python and install.
Step 2:
Download Atmel FLIP and install.
Step 3: Download metalliqaz' excellent Easy AVR USB Keyboard Firmware and Keymapper, with the additions for the JD40 Mk.II by MajorKoos. For the JD40 Mk.II, you'll definitely want the Python version, not the compiled Windows executable. I've attached the ZIP archive to this post. If you don't need the code for the JD40, you can use either the attached Python version, or the compiled Windows installer, available
here.
Step 4: Start Easy AVR by executing the run.bat script. Select File>New Default Layout..., and select either JD40 MkII (Carpe Keyboards) or JD45 (Carpe Keyboards), depending on which keyboard you have. Alternately, you can use my saved default layouts, attached to this post, by choosing File>Open Saved Layout...
Step 5: Modify the keymap to suit your preferences.
Step 6: Save your new layout by choosing File>Save Layout As...
Step 7: Build the firmware .hex file by choosing File>Build Firmware...
Step 8: Open the Atmel FLIP application you installed previously
Step 9: Connect the keyboard to your PC via USB. Windows should install the drivers automatically.
Step 10: Press the small button switch on the back of the PCB (accessible via the hole in the case) to jump into bootloader mode. At this point, Windows may or may not install the correct drivers for the device.
Step 10a: If necessary, manually install the driver for the bootloader from C:\Program Files (x86)\Atmel\Flip 3.4.7\usb (or wherever you installed FLIP. Open Device Manager, double click on the device, and select the Driver tab. Click Update Driver, and point it at the 'usb' folder mentioned above.
Step 11: In FLIP, select File>Load Hex File... and select the firmware you just built with Easy AVR.
Step 12: Click the IC icon, and select ATmega32U4. Click OK.
Step 13: Click the USB icon, and select USB. In the USB Port Connection window, click Open. If an error occurs, the correct driver is not installed. See Step 10a.
Step 14: Click the Run button on the bottom left. The software should now erase the flash on your chip, program the new firmware to flash, and verify the programming.
Step 15: Disconnect the keyboard from the PC.
Step 16: Connect your keyboard via USB again, and verify that the new firmware programming is correct. I recommend the useful Aqua's Key Test application (attached) for this.