hidkey_gpio
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
hidkey_gpio [2012/11/27 02:11] – [Results] steve_m | hidkey_gpio [2013/02/27 00:10] (current) – [Results] steve_m | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== AVR Programmer built from a USB Keyboard ====== | ====== AVR Programmer built from a USB Keyboard ====== | ||
- | Recently, my old keyboard became louder and louder while typing, so I decided to buy a new one. But what to do with the old one? Ever since I saw the [[http:// | + | Recently, my keyboard became louder and louder while typing, so I decided to buy a new one. But what to do with the old one? Ever since I saw the [[http:// |
===== Theory ===== | ===== Theory ===== | ||
Line 30: | Line 30: | ||
|Caps lock|MOSI|out| | |Caps lock|MOSI|out| | ||
|Scroll lock|Reset|out| | |Scroll lock|Reset|out| | ||
- | |row/column of right shift key|MISO|in| | + | |row/column of right shift key|MISO |
For the optocoupler I added a 470Ω current limiting resistor. | For the optocoupler I added a 470Ω current limiting resistor. | ||
Line 36: | Line 36: | ||
===== Software ===== | ===== Software ===== | ||
- | First I wrote a small libusb-based test utility for experimenting with the keyboard. I'm directly communicating with the keyboard from userspace, unloading the kernel driver first. | + | First I wrote a [[https:// |
==== Speed ==== | ==== Speed ==== | ||
Line 79: | Line 79: | ||
</ | </ | ||
- | Well, as you can see, programming takes quite a while, mainly because of the slow input speed I mentioned before, but is very reliable. Since I assume that many people have some old USB keyboard | + | Well, as you can see, programming takes quite a while, mainly because of the slow input speed I mentioned before, but is very reliable. Since I assume that many people have some old USB keyboard |
===== Update #1 ===== | ===== Update #1 ===== | ||
- | Since reading the MISO input is much slower than writing the outputs, as I mentioned above, I took a closer look at the avrdude code. As it turns out, the inputs are read every time, even if the data isn't used at all (like when writing a byte). I applied a crude hack, so that MISO is only being read if the data is used afterwards. I pushed that change to a new [[https:// | + | Since reading the MISO input is much slower than writing the outputs, as I mentioned above, I took a closer look at the avrdude code. As it turns out, the inputs are read every time, even if the data isn't used at all afterwards |
With those changes, flashing my 86 byte demo application is now over ten times faster (11.75s vs. 123.79s)! | With those changes, flashing my 86 byte demo application is now over ten times faster (11.75s vs. 123.79s)! | ||
Line 145: | Line 145: | ||
I'd say that's quite an improvement, | I'd say that's quite an improvement, | ||
+ | |||
+ | This project was featured on [[http:// | ||
== Reference Literature == | == Reference Literature == |
hidkey_gpio.1353982295.txt.gz · Last modified: 2012/11/27 02:11 by steve_m