Editing
AVR-Keyboard
From Deskthority Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
This will be an article on the Bathroom Epiphanies AVR-Keyboard firmware (and it's derivatives). The files are available at [https://github.com/BathroomEpiphanies/AVR-Keyboard this] github page. =File list= {| class="wikitable" border="1" |- ! Filename ! Description |- | firmwares/ | Folder with pre-compiled firmwares. |- | hid_liber/ | Each physical board has its own folder with files defining the matrix layout and other parameters. |- | hid_liber/board.h | Includes board parameters for number of rows/columns, microcontroller specifics, and declarations of the functions to interface the board. |- | hid_liber/board.c | This is where the microcontroller pin-out is defined, and the function definitions for the interface can be found. |- | hid_liber/ansi_iso_jis.h | Pretty much just a dummy file. |- | hid_liber/ansi_iso_jis.h | Here is where the actual layout is defined. |- | [other board specific folders] | |- | [...] | |- | Makefile | Magic make stuff to compile everything correctly. This is where the board and layout to be compiled is selected. |- | README.md | |- | avr.h | Extra definitions to make life easier.. |- | avr_keyboard.c | The main program code. |- | hid_listen | A monitor that listens to debug data sent back from the keyboard. Compiled on Ubuntu 12.04 64-bit. |- | print.h | Includes functions for debug printing. |- | print.c | Includes functions for debug printing. |- | usb_keyboard_debug.h | The HID keyboard framework supplied by [https://www.pjrc.com/teensy/usb_keyboard.html pjrc.com]. |- | usb_keyboard_debug.c | The HID keyboard framework supplied by [https://www.pjrc.com/teensy/usb_keyboard.html pjrc.com]. |} =Procedures= ==Building the firmware== The make system keeps track of what needs to be compiled and how that is supposed to be done. It does not work perfectly for this project. Changing the microcontroller used requires a 'make clean' to be done. Each board has a section in the beginning of the file. The correct one needs to be un-commented before compiling. Parameters that need to be defined. BOARD = hid_liber // Folder for board specifics LAYOUT = ansi_iso_jis // Required layout for that board. Located in the BOARD folder. MCU = atmega32u4 // Microcontroller the board uses F_CPU = 16000000 // CPU speed B_LOADER = \"jmp\ 0x7000\" // Memory location of the bootloader section To compile the firmware run the commands make clean; make ==Flashing the firmware== ===Linux=== Install dfu-programmer sudo apt-get install dfu-programmer Reset the controller, and run the following commands sudo dfu-programmer atmega32u4 erase; sudo dfu-programmer atmega32u4 flash avr_keyboard.hex; sudo dfu-programmer atmega32u4 start ===Windows=== ==== Atmel Flip ==== You need the Atmel [http://www.atmel.com/tools/FLIP.aspx Flip] software installed to your system. If you find that USB comms is not working, use these directions: [[Flip-USB]] # Plug in your keyboard # Start Flip # Click the Chip icon (first one) # Select the ATmega32U4 from the list # Click the USB icon # Get your KB to jump to the bootloader (both shifts, or a magnet over the controller) # Click Open (keep trying, takes a moment for the chip to be ready after jumping to the bootloader) # Click the File menu and select your HEX file # Click Run on the bottom left # Click Start Application on the bottom right # Wait a moment and your KB should be live with your new firmware ==== dfu-programmer ==== Since version 0.5.5 there is a windows binary and drivers available [http://dfu-programmer.sourceforge.net dfu-programmer-win]. The usage is obviously the same as the linux-version of it. You might want to delete the versionnumber in the filename in order to make it work with existing Makefiles too. dfu-programmer atmega32u4 erase dfu-programmer atmega32u4 flash avr_keyboard.hex dfu-programmer atmega32u4 start =Hints to having a comfortable programming experience= * Install Linux (Ubuntu recommended for beginners). http://www.ubuntu.com/download/desktop/windows-installer * Install a '''worthy''' text editor -[[sublime]] for beginners, [[emacs]] if you are a bit crazy, [[vim]] if you are flat out insane, and [[gedit]] will do nicely. sudo apt-get install emacs * Make sure you have the needed software installed sudo apt-get install gcc-avr binutils-avr avr-libc =If you still want to do it under Windows= * There are good text-editors too (Like Notepad++,...) * Download and install [http://sourceforge.net/projects/winavr WinAVR] for the compiler and so forth. Make sure the path to the WinAVR-directory has no spaces in it or else you might get errors. =External links= * https://github.com/BathroomEpiphanies/AVR-Keyboard * http://pjrc.com/teensy/usb_keyboard.html * http://www.atmel.com/devices/atmega32u4.aspx * http://www.atmel.com/tools/FLIP.aspx * http://sourceforge.net/projects/winavr * http://dfu-programmer.sourceforge.net [[Category:Keyboard modding]]
Summary:
Please note that all contributions to Deskthority Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
Edit source
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Deskthority forum
Support Deskthority
Search
Main categories
Guides
Keyboards
Keyboard switches
Keycaps
Keyboard modding
Pointing devices
Brands & companies
Group buys
Other topics
Wiki info & links
Recent changes
Random page
All pages
Deskthority wiki help
MediaWiki help
Tools
What links here
Related changes
Special pages
Page information