Iambic to USB Hardware Working

Here is my Iambic USB hardware.
This little device accepts Iambic key input and sends it to the USB port on my computer. The Teensy 2.0 looks like a keyboard to the computer so no special drivers or software are needed for the key to work.

I have used Visual Studio a lot so it was a natural to go searching for a way to program the Teensy 2.0 board using the VS IDE. Folks have already done the heavy lifting so it was not hard to get Atmel Studio up and running. Atmel Studio 6 is free and works with all their AVR chips. I installed that and was able to compile the source code for the inspiration project right away.

The inspiration project source code has a bug in morse.h that makes the letter X not work. I fixed it by finding out how the Morse code was being encoded. The include file morse.h defines a look-up table that matches encoded Morse characters to keyboard codes. The Morse encoding scheme by Mark VandeWettering, K6HX, defines a binary sequence of 0 for dit and 1 for dah in left to right order. The sequence begins after a single sentinel bit set to 1. So the letter A sequence is 101. A 1 for the sentinel followed by a 0 for dit and a 1 for dah. The array in morse.h is written with hex codes so the letter A is associated with [0x0005]. I used the handy programmer view in the Windows calc program to translate the pattern for the letter X into hex; 11001 in binary becomes 0x0019. I found KEY_X in the table and changed the code to 0x0019 and got X when I keyed in X.

AVR chips are so much easier to program now. The entire Arduino phenomenon has made it easy to build your own embedded devices. I really like the Teensy 2 board from PJRC. You can hook it up and program the chip without serial drivers, the device is super fast, the internal software ‘magic’ is super small, and you can use the free Atmel Studio 6 development environment.

Next for the project? I’m untangling the code so I can figure out how to add a speed pot. Also, automatic spacing would be nice.

One response to “Iambic to USB Hardware Working”

  1. Kevin

    Ever get the speed pot working? I happen to be playing with the same thing and hate to reinvent the wheel 🙂

Leave a Reply