Hello!
Lately I have been teaching myself the ancient art of Morse Code. For transmission trainging I got a proper Straight Key from eBay, and wrote a sketch for an Arduino Leonardo that converts the "dots" and "dashes" on the key to keyboard input for the PC. It worked, but then I read about the current 43Oh Contest of the Month and decided to take this to the next level...
So here it is - the MSP430 Morse Trainer 1.0
This standalone device has two inputs: the Morse straight key (which is essentially a momentary, "Normally-Open" switch) and a microswitch. The microswitch accepts, in the spirit of Morse code, short presses (to reset current mode) and long ones (to switch mode). There are two modes of operation: "Free", which allows the user to key in different characters freely, and "Test" which generates random test strings that the user is required to key in. The test mode keeps score for the current string, and also displays it using a simple "animation" at the end of each test.
Here's an image of the free mode. I had to dim the display's backlight using a resistor because it blinded the camera. Believe me, it looks a lot better in real life.
Edit: Yes, there's a typo in there... or is it a keyo? :-)
All text is displayed on a 16x2 LCD; I got one that said "3V" in the eBay description, but maybe standard "5V" ones would work just as well. Two charlieplexed LEDs indicate the current mode on the panel, and there's a "continuous" piezo buzzer that echoes the key because you have to have beeps in Morse code :-)
Here's the test mode in mid-test. Notice the V's and the X's that mark right and wrong answers.
And when the test is done, the score is shown both in the text above and in bar animation that ends like this:
The entire thing is run by a single, stand-alone MSP430G2452. I programmed it with Energia and an MSP430 Launchpad. I chose it over the MSP430G2553 because I wanted to keep that one for other projects, and for the challenge of squeezing the code into the 2452's smaller space. Now, the code is far from optimal - I'm still not familiar with the inner workings of these chips - but I'm kind of proud of the economical Morse-to-ASCII conversion. The code uses the LCD library that comes with Energia.
Here's my code:
MorseTrainer.ino 10.8KB
3 downloads
Can someone please tell me how to paste the code in a nice box with vertical scroll and syntax highlight? The "code" tag isn't giving me that.
A cardboard structure (originally, the lid of a webcam packaging) houses the components. Most of the stuff is held in place using hot glue, and there are some LED holders too. I printed a "panel" on paper and taped it to the cardboard; it includes the Morse code reference. Here's the MS-Word file for printing the panel:
MorseTable.doc 62KB
1 downloads
That's how it all looks inside. Wires are connected with headers for modularity and due to laziness ;-)
Edit: The red wire for the piezo buzzer (bottom right) isn't connected to the right place - I disconnected it temporarily and forgot to put it back for the picture. It should go to any 3.3V connection.
Edit II: Of course, the power source isn't in the picture. There's a 3.3V Voltage Regulator there that accepts ~3.5-6V, so the power lines from a USB are optimal. It can also take 3-4 AA/AAA batteries, a LiPo cell etc.
And the schematics:
I will post this project on the Contest of the Month thread as soon as I make a proper video. Comments and questions are obviously welcome!