I talked about Dave's very flexible encoder in my previous log and in this one I'll cover it's construction.
I'm still waiting for the keyboard switches to arrive (last seen in Chicago IL), but the hardware for the encoder hit my mail box a couple of days ago. I followed Dave's assembly notes on GitHub. Here is what the end result looks like.
The assembly was all pretty straight forward. Nothing to see here. What was a little trickier was flashing the ATmega328P with the encoder firmware. Dave uses Atmel Studio 7 to build the firmware and a high end Atmel-ICE programmer burn the chips. A little out of my price range.
Fortunately you can use practically any Arduino as an AVR programmer. There is a lot of sometimes confusing information online on how do do this. I'll just tell you about what worked for me.
I started by opening the Arduino IDE and loading the sketch ArduinoISP.
I had a Arduino UNO attached on COM12 so I compiled and uploaded ArduinoISP with the following settings.
Then I switched the Programmer: setting in the IDE to Arduino as ISP.
Using jumpers I wired the Arduino UNO to the encoder board's ISP Header with the following connections.
Arduino | ISP Header |
---|---|
Pin 10 | Pin 5 (RESET) |
Pin 11 | Pin 4 (MOSI) |
Pin 12 | Pin 1 (MISO) |
Pin 13 | Pin 3 (SCK) |
+5V | +5V |
GND | GND |
Here is my setup.
The Arduino IDE uses a command line program called avrdude under the covers to flash AVR devices. Getting the command line parameters to this program correct can be tricky. Fortunately there is a GUI called avrdudess which can be found here that I downloaded.
I didn't have an environment setup to build Dave's encoder firmware, but he was kind enough to send me the latest build's HEX file. At this point I was all set to flash the ATmega328P on the board. I fired up avrdudess.
I altered the following inputs:
- Changed Port to the com port the UNO was attached to: COM12.
- Set the Flash input field to Dave's firmware HEX file.
- Changed the MCU to the target device ATmega328P.
- Entered the Fuse settings that Dave provided: Low 0xD2, High 0xD9, Ext. 0xFF.
Then I pressed the Program! button. You can see that the writing and verification all checked out so the keyboard encoder is ready to go.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.