The Artima Developer Community
Sponsored Link

Python Buzz Forum
My New Old Keyboard

1 reply on 1 page. Most recent reply: May 18, 2019 4:23 AM by messy tyagi

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
    Next Topic
Flat View: This topic has 1 reply on 1 page
Aaron Brady

Posts: 576
Nickname: insommeuk
Registered: Aug, 2003

Aaron Brady is lead developer for Crestsource
My New Old Keyboard Posted: Jun 1, 2014 5:32 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Aaron Brady.
Original Post: My New Old Keyboard
Feed Title: insom.me.uk
Feed URL: http://feeds2.feedburner.com/insommeuk
Feed Description: Posts related to using Python. Some tricks and tips, observations, hacks, and the Brand New Things.
Latest Python Buzz Posts
Latest Python Buzz Posts by Aaron Brady
Latest Posts From insom.me.uk

Advertisement

Coming up on two years ago, Nick (our Managing Director at work) ordered this:

New Apple Keyboard

and got this:

20 Year Old Apple Keyboard

It’s definitely one of the funniest cases of Amazon product substitution that I’ve seen, and due to massive amount of badly-written robots crawling Amazon listings and fuzzily matching ASINs up to their own catalogues, it may not be unique.

No one wanted to deal with packaging up and raising customer service tickets with Amazon for the sake of a keyboard, so Nick ordered an official keyboard and let me keep the design classic1 that is my Apple Extended II keyboard.

I grabbed the Apple IIgs hardware reference from some web page somewhere, and digested the Microchip ADB interfacing tech-note. I found and pored over someone else’s ADB Arduino code, and I wrote quite a bit of timing specific Arduino code but never got very far. I managed to send instructions over ADB - turning on and off the caps-lock light - but never once managed to read a keystroke.

I had followed the tmk_keyboard discussion on GeekHack and starred the project on GitHub. It relied on a Teensy 2.0, which aren’t available cheaply (or, at least, as cheaply as I would like) in the UK. Early versions needed the Teensy because they used the PJRC USB stack, which I believe is only (legally) available on a Teensy board.

Lots of time has passed, and I checked back in on GitHub to see that an alternative USB stack is now supported: LUFA. This means that you can run tmk_keyboard on any compatible ATMega device. Looking at the available clones I picked out a not-quite-Arduino Pro Micro and waited patiently for it to arrive.

It arrived.

Sadly, in the mean time I had started another electronics project at work, and have left the only other Arduino I have there, along with my Bus Pirate. I had planned on using either the ArduinoISP sketch or the Bus Pirate to program the firmware straight over the top of whatever is included on the Pro Micro out of the box, but wasn’t about to make the trip to work to do it.

I also wasn’t really keen on waiting either.

The Pro Micro ships with a bootloader that appears as a AVR109 compatible programmer. This might be a one-time shot I had at this, but I was happy to take that chance as I could always unbrick the device when I got my hands on a proper programmer.

Building the firmware, I should point out, was really simple. I got the cross development tools that the README recommended, commented out some features from the Makefile that I felt I didn’t want to spend any RAM on, and I ran make. It spat out a .hex file ready to write.

I got the command line ready in my terminal

sudo avrdude -P /dev/tty.usbmodem* -p atmega32u4 -cavr109 \
    -v -v -v -e -U flash:w:adb_usb_lufa.hex

and brought RST down to ground twice. This last step is covered in the unbricking guide for this Arduino, but I had to do it in order for avrdude to even see the device.

Unplugging the cable and plugging it into my Linux box heeded this fist-pump success moment:

[ 9088.741998] hid-generic 0003:FEED:0ADB.0005: input,hidraw0: USB HID v1.11 Keyboard [t.m.k. ADB keyboard converter] on usb-0000:00:1d.1-1/input0

The board was alive; I hadn’t bricked it and it came up with the right USB identifiers! I then proceeded to have some pain with pull-up resistors (I didn’t have the right ones to hand, I made do, they were wrong) and had to make some use of the hid_listen command to get debugging output from the board.

[ Also, isn’t it cool that you can basically get a console from your keyboard firmware? Powerful devices are so cheap. ]

I wrote out the standard, correct test:

The quic brown fox jumps over the lazy dog.

Hm.

So, it looks like at some point in the last 20 years, someone has damaged the k key. This keyboard is really serviceable, so I was able to undo one screw and two clips and have the thing flipped over, solder side up.

Picture of PCB

Checking the points for the k with my meter shows it was never registering a click. I desoldered it following a guide to repair ALPS white switches - but it was too damaged. I’ve swapped it with F15, leaving me with a temporary unsightly gap.

I now have a fully functioning twenty year old loud mechanical keyboard. All that remains is to make a decent case for the adaptor.

Current Status:

Current Status

Patching into an RC car’s resistors2:

OMG OH NOES


  1. I got free tickets to the Design Museum in London last year, and they literally had one of these keyboard on display, next to the also iconic but much less pleasant to use ADB mouse. 

  2. Yes, really. My desperation at not being able to find a 1K resistor for a 5V pull-up lead to me patching into the resistors soldered on to other items. Not proud. Well. A little proud. 

Read: My New Old Keyboard


messy tyagi

Posts: 1
Nickname: messytyagi
Registered: May, 2019

Re: My New Old Keyboard Posted: May 18, 2019 4:23 AM
Reply to this message Reply
https://www.google.com/
<a href="https://www.google.com/">ding a ling</a>
ding a ling
Google

Flat View: This topic has 1 reply on 1 page
    Next Topic Topic: C

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use