EasyAVR
Easy AVR USB Keyboard Firmware and Keymapper
Find info and downloads at the DT Wiki: https://deskthority.net/wiki/Easy_AVR_USB_Keyboard_Firmware
Ask questions in the GH thread: https://geekhack.org/index.php?topic=51252
View the source code on Github: https://github.com/dhowland/EasyAVR
Table of Contents
Windows User Tutorial
Requirements
- Atmel Flip
- Teensy Loader (for Teensy-based boards)
- Optional: Python 2.7 or 3.3+
Installation
Windows users have two options for using the Easy AVR keymapper. The easiest option is to use the stand-alone compiled executables. Alternatively, users familiar with the Python interpreter may run the Python scripts directly.
Compiled executables
- Download the executables from the wiki page
- Extract the zip to the chosen installation location
- Start the tool by running easykeymap.exe
Python scripts
-
Download the source code from Github and extract
-
Start the tool with the run.bat (requires python in the PATH)
-
Optionally, the easykeymap package can be installed with setuptools
python setup.py install python -m easykeymap.gui
Creating A Keymap
- Create a new layout and select your board -or- open a previously saved layout (File menu)
- Copy/Paste the default layer to populate any Fn layers that you intend to use (Edit menu)
- Modify your layout using one of the three edit methods:
- Select a key in the keymapper and press the new assignment on your physical keyboard
- Select a key in the keymapper and then choose a new scancode from the menu
- Open the scancode picker, select a key in the keymapper, then select the new assignment in the picker
- Read the manuals for help on using advanced features of the firmware such as macros and LED assignments (Help menu)
- Save your new layout (File menu)
- Build your firmware into a .hex file (File menu)
Programming The Firmware
The programming of the firmware to your board depends on your hardware. Boards based on a Teensy (e.g. Phantom) use the Teensy Loader app. Other AVR boards use the Atmel Flip app.
Flip
- Open the Atmel Flip app
- Click the red "Load HEX File" icon and open the .hex file you created in the keymapper
- Click the microchip "Select a Target Device" icon and choose the AVR used by your board (usually ATmega32U4 or ATmega32U2)
- Put your keyboard into bootloader mode
- Click the USB "Select a Communications Medium" icon and choose "USB" from the menu
- With the AVR now connected, click the "Run" button to reprogram with the new firmware
- With a successful completion, click the "Start Application" button
Teensy
Follow the instructions at the Teensy website
Linux and Mac User Tutorial
Requirements
- dfu-programmer
- Teensy Loader (for Teensy-based boards)
- Python 2.7 or 3.3+
Installation
dfu-programmer
dfu-programmer can be installed on Linux using your chosen package manager. Typically, it will look something like this:
sudo apt-get install dfu-programmer
dfu-programmer can be installed on OSX by following these directions or with Homebrew as follows:
brew install dfu-programmer
Easy AVR
-
Download the source code from Github and extract
-
Start the tool with the easykeymap.sh
-
Optionally, the easykeymap package can be installed with setuptools
sudo python setup.py install python -m easykeymap.gui
Programming The Firmware
dfu-programmer
-
Create a firmware as explained in Creating a keymap
-
Put your keyboard into bootloader mode
-
Program your .hex file (replace device type as necessary)
sudo dfu-programmer atmega32u4 erase sleep 10 sudo dfu-programmer atmega32u4 flash /path/to/firmware.hex sudo dfu-programmer atmega32u4 launch
AVR-dude may also be used on Linux, as explained here.
Teensy
Follow the instructions at the Teensy website
Supporting Custom Boards
Requirements
- A text editor
- Reading comprehension
Setup
- Download the source code from Github and extract
- Run the keymapper at least once (see above)
- The tool automatically creates
~/.EasyAVR/
(probably/home/username/.EasyAVR
on Linux andc:\users\username\.EasyAVR
on Windows) - In the source code, find
keymapper/easykeymap/boards/handwire.py
and copy it to~/.EasyAVR/boards/
- Rename your copy of
handwire.py
to anything you like, for examplemy_first_board.py
- This can be done for any number of custom boards
Configuring A Custom Layout
- Open
my_first_board.py
in a text editor - This file is a pure Python script that describes the keyboard hardware -- you must use correct Python syntax!
- Read ALL comments in the file and follow those directions
- In particular, make sure to give your board a unique
unique_id
- The example file describes the Phantom, use this as a template to configure your own board
- Make sure to consider and update every setting in the file
- Save your file, then restart the Easy AVR keymapper app
- Create a new layout, select the board you configured, and test it
- Remember that if you change the hardware description in the config file, you MUST NOT load saved keymaps created with the old config file
Developer Notes
Requirements
- Python 2.7 and 3.3+ (both would be needed for complete testing)
- Atmel Studio 7
Abandon all hope, ye who enter here.
TODO: write developer notes