igendel

MSP430 Morse Trainer 1.0

12 posts in this topic

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.

post-30511-0-86065500-1386981070_thumb.jpg

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.

post-30511-0-28505300-1386981046_thumb.jpg

 

And when the test is done, the score is shown both in the text above and in bar animation that ends like this:

post-30511-0-51262300-1386981054_thumb.jpg

 

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

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

 

That's how it all looks inside. Wires are connected with headers for modularity and due to laziness ;-)

post-30511-0-30963200-1386981026_thumb.jpg

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:

post-30511-0-91825000-1386981033_thumb.png

 

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!

bluehash, RobG, petertux and 1 other like this

Share this post


Link to post
Share on other sites

Neat project! Thanks for sharing. What did you use to make the schematic?

Tag at the bottom right suggests "Fritzing".

Share this post


Link to post
Share on other sites

Tag at the bottom right suggests "Fritzing".

Fritzing indeed. In my smaller projects I don't usually bother with schematics - only comments on the code and the occasional Pencil-and-Post-It... but for this one I got all fancy :laugh:

Share this post


Link to post
Share on other sites

The educational boosterpack has an LCD, a buzzer and an RGB LED. When using the accelerometer or gator holes as key, you could do this whole project adhering to "standards". That would be kinda cool I think.

 

Oh, use

 instead of just [code ]
igendel likes this

Share this post


Link to post
Share on other sites

The educational boosterpack has an LCD, a buzzer and an RGB LED. When using the accelerometer or gator holes as key, you could do this whole project adhering to "standards". That would be kinda cool I think.

 

Oh, use

 instead of just [code ]

 

Yes, but I don't have any boosterpacks... :blush:

From my experience, keying Morse code fast without a real key is difficult. These mechanisms were indeed perfected over time. Perhaps the boostepack option will be good for absolute beginners, and/or those who don't want to mess with all the construction :smile:

 

Thanks for the =js tip, I'll try it soon.

Share this post


Link to post
Share on other sites

The gator holes allow you to use alligator clamps to connect your real key to the booster pack.

I did a quick hack to get is working, but I need some more fiddling with it. First the LCD is different (I2C based), but there is a library for it. Second the buzzer is not continuous so needs PWM driving.

Last the RGB LED is too bright, so I need to fix that too.

Share this post


Link to post
Share on other sites

@@igendel Thank you for making a video. You put a good amount of work in that.

I tries to attach an updated schematic (for the standalone chip instead of the Launchpad), but my browser encounters  some script problem, so that'll have to wait I guess

 

Could you mail me your attachment at admin at 43oh dot "you know it".

Share this post


Link to post
Share on other sites

The gator holes allow you to use alligator clamps to connect your real key to the booster pack.

I did a quick hack to get is working, but I need some more fiddling with it. First the LCD is different (I2C based), but there is a library for it. Second the buzzer is not continuous so needs PWM driving.

Last the RGB LED is too bright, so I need to fix that too.

 

I'd put a small piece of paper over the LED :smile: I'd love to see how this works out on the different "platform"!

 

 

@@igendel Could you mail me your attachment at admin at 43oh dot "you know it".

 

No need - Apparently there was something wrong with the file itself (too large resolution?) - I reduced the resolution, the size went from ~370K to ~204K and it was uploaded fine for the competition post.

 

Here it is:

post-30511-0-22960900-1387149936_thumb.png
bluehash likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now