Morse code converter.

Rickharris

Senior Member
Stan may well know the answer to this:

I know he has posted an 08 Morse code generator, and I know that several people have produced Morse to text programmes for PC systems using the sound card as the input device.

Has anyone tried to do the translation of code to text with a picaxe with output to LCD? Seems like an interesting application with the advent of cheap TX RX systems.

A search on possible threads showed nothing for me.
 
Last edited by a moderator:
Looking at the program from Stan's site

http://picaxe.orconhosting.net.nz/morse.bas

Code:
'copied from 
'http://picaxe.orconhosting.net.nz/morse.bas

Symbol Dit_length = 7		'set length of a dot     (7 milliseconds)- yields 10wpm
Symbol Dah_length = 21		'set length of a dash	 (21 mS = 3 dots long)
Symbol Wrd_Length = 43		'set space between words (43 mS = 2 dashes, 6 dots)

"machine perfect" morse might be in with a chance,
using pulsin / count and a big lookup table.

But, "human" sending, with varying patterns (I think it's called "fist").
Hmmm?

I'm sure Stan will provide much more info, in a few hours.

e
 
Haven't tried it but it should be possible if the PICAXE is fast enough to do its thing between dit and dah gaps - The biggest problem is perhaps working out how long a dit or dah is to start with to be able to distinguish the two.

Turning dits and dahs into a character could also be time intensive if done the wrong way, ie a lookup table checked after each dit or dah; I'd use a binary tree, a sequence of IF-THEN's to determine what each could be, but that might be getting ahead of myself ...

It's tempting to say buffer the length of each dit or dah then post-process when an inter-character gap is received but then we're back to the issue of how much processing time there is between detecting that and the next dit or dah.

Perhaps a daisy-chain of PICAXE's each doing its own thing; the first timing dit or dah length, another looking for inter-character gaps, a third determining which are dits and dahs, another working out what that sequence means and passing it on to an AXE033 or another PICAXE driving an LCD.

A PC or fast micro would have plenty of time to do all that in one program.
 
Morse code protocol

From an Avionics signal generator manual, the protocol is:
Tone frequency is 1020 Hz
Dot = 100ms duration
Dash = 300ms duration

duration between dots and dashes of same letter is 100ms (no tone)
Letter space = 300ms duration (no tone)
Word space 500ms duration (no tone)
 
Last edited:
I recall my Kiwi mate Andrew "Brightspark" gave 08M Morse decoding a scare. As a ham from an era when Morse was compulsory, & one who once spent way too long on the bands (although mostly AM/SSB eventually), I can certainly verify "fist" issues throw all but the smartest decoders. Suggest you try some of the many PC sound card based decoders before taking this further. Stan
 
Stan you're 100 percent correct!

RickHarris, stick with a PC software/sound card Morse Code decoder. There are many software freebies out there that are great! Especially with the advent of Sound Cards these days and Digital Signal Processing etc. etc. They really perform extremely well receiving really weak signals. ((Not saying the PICAXE approach will not work.))

I once built a simple LM 741 OpAmp circuit that took the receiver’s speaker audio and converted or “squared” it. This was then applied to one of the printer port pins on my Tandy TRS-80 or my old 286-12Mhz. PC. ((showing my age)) The small GWBasic program could certainly decode it.

As long as:

Both stations were sending at the same speed and were very strong. Well I guess it worked OK for back then.

Some problems:

The signal received by the radio needed to be an extremely strong signal. It appeared the simple OpAmp circuit “squaring” the received audio had difficulty if the received signal wasn’t literally many many dB above the noise.

Problems also accrued if there were two signals in the receivers passband. “Receiving two Morse Code signals at the same time” from different stations. This obviously produced lots of gibberish on the ol’ CRT. This problem could be solved if the receiver incorporated a narrow CW filter. But worst case was during a “pile up”!!! Multiple stations being received at the same time. This produced nothing but gibberish!

And then there is the “fist” problem that Stan mentions. If the radio operator sends a 20 word sentence and the “speed” goes from 10 Words Per Minute to 13 WPM, back to 11 and then up to 12 …. That didn’t cope well either. But usually decoded enough to understand what was being said.

Mind you, there were and still are some old fabulous high speed Morse Code radio operators on the Amateur Radio bands these days. The ones I met are usually ex-military radio operators from the 40’s and 50’s or from some other commercial radio service. It’s truly amazing to watch them operate, as they don’t listen to the code as dots and dashes. They write nothing down on paper! They just listen for words and understand it as if it were a second language.

It would be interesting to see just how fast a PICAXE could decode and print to an LCD. At high speeds the Serial LCD might be out of the question.

The Addict
VK6HV
 
I've been a CW only op since 1950s - one thing that amazed me early on was watching shipboard Navy ops copying CW from headphones to typewriter - while talking with operator next to them...!! However when they had to send their voice com immediately shut off and they resumed conversation where left off when their sending was terminated - amazing brain function! AJ0J
 
If I've got this figured right, the old ham standard is WPM equals the number of times you can send PARIS in one minute.

With 5 baud inter-character spacing and 7 baud inter-word spacing, I make that 58 baud for each iteration of PARIS.

Taking those figures, the attached chart gives the times for dot/element space and dash times for speeds from 5 to 35 WPM.

Although I've never tried to write a Morse decoder (I copy just fine by ear, thank you, and particularly well in pileups), I've read that your timing must be adaptive if you want to have any success at all copying hand-sent code.

If you plan to try this with a Picaxe, you'll need a super filter out in front of it. Something on the order of 50 Hz, with AGC, perhaps, ahead of your audio-DC converter circuit. It can even ring a little bit, if it damps quickly.

Good luck with your project. It should be interesting.

73,

Tom AB9B
 

Attachments

  • MorseBaudTime.jpg
    MorseBaudTime.jpg
    22.7 KB · Views: 30
Although I've never tried to write a Morse decoder (I copy just fine by ear, thank you, and particularly well in pileups), I've read that your timing must be adaptive if you want to have any success at all copying hand-sent code.

Tom,

This is total proof that humans are smarter then computers:) At least my old Tandy TRS-80. As many my know, it was also known as the "Trash 80"!

No way was my old boat anchor computer and Basic program was able to copy any one station in a pile up with out filters..... but humans can!
 
Take a look at the ARRL site also - there used to be morse programs there - if you want just practice I wrote a QBASIC program for sending practice material - selected characters or everything... [though I don't remember what the new morse for @ is].
 
It has taken me a while to completely work through the issues, but an 08M2 can support decoding at 10WPM and a 20X2 can support decoding at 25+WPM, straight keying. Figures are a little higher with Farnsworth spacing/timing.
I have complete 08M2 code posted in the Communications section and I have additional info http://www.picaxeforum.co.uk/showthread.php?19085-Morse-Code-Decoder-for-Cheap-using-a-20X2/page2&highlight=morse%2A. I also have some relaxed conversion algorithms in my blog here on PICAXE. One of the prototypes has been denoted to the ARRL for review in hopes that I can more easily support those who wish to learn/enhance their skills using an easily constructed device.

- Ray
 
Morse code converters are digital tools used to translate standard text (letters, numbers, and symbols) into the "dits" and "dahs" of Morse code and vice versa. In 2026, these tools have evolved from simple text-swappers into interactive learning hubs.
 
Sounds like the idea I ran past Stan a few years back ?

I have a DC, Audio and RF Morse TX and or Rx using just Battery + an 08M2 DIL chip.
It does Tx OR Rx on a single chip exploiting the massive leap in technology with the release of the mighty 08M chip :)
as a MODEM concept It exploits The 'data' statement that stores ASCII <> 8 bit zero crossing pattern of Morse square wave pattern and state of the art ASII code = lots of 8 bit patterns enough even for a human !

RF Option:
* The 08M PWMOut Tx'r option can transmit RF across the kitchen table over the MW band
* Pin2 'RF' 500kHz PWMOut x Pin1 'Sound' modulation 'AM' (short both pins together)
It really needs a nice RF OP stage BC337 and a 'Tank Circuit' of some design ;)

Can dig out and add comments and post if needed by anyone who has a Lot of time to figure out how it works !

~ A
 
Back
Top