CW Flasher
n1iic
Posts: 19
Greetings, everyone.
I just bought the 'What is a Microcontroller' kit from RS last week hoping to make a few different projects.
I am starting with trying to make a LED flash CW. I started writing the code with the references for each letter, and then I found this code at http://www.qsl.net/kc8qno/Files/beacon_key(trans).bs2
I am trying to learn his code, but he says no support is available, so I didn't bother him.
*EDIT* I deleted the code that was here, it was malfunctioning code, and made for a long thread /EDIT
I realize that it is converting binary into dits and dahs, but how???
And what does changing the number in ELEMENTS do.
Feel free to start with a hint to point me in the right direction to finding my own answer. =]
Jason
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sick and tired of our media and the cheesy radio DJ's in the US? http://www.opieandanthony.com
Post Edited (n1iic) : 7/19/2005 9:12:01 PM GMT
I just bought the 'What is a Microcontroller' kit from RS last week hoping to make a few different projects.
I am starting with trying to make a LED flash CW. I started writing the code with the references for each letter, and then I found this code at http://www.qsl.net/kc8qno/Files/beacon_key(trans).bs2
I am trying to learn his code, but he says no support is available, so I didn't bother him.
*EDIT* I deleted the code that was here, it was malfunctioning code, and made for a long thread /EDIT
I realize that it is converting binary into dits and dahs, but how???
And what does changing the number in ELEMENTS do.
Feel free to start with a hint to point me in the right direction to finding my own answer. =]
Jason
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sick and tired of our media and the cheesy radio DJ's in the US? http://www.opieandanthony.com
Post Edited (n1iic) : 7/19/2005 9:12:01 PM GMT
Comments
Consider SOS
Where (EP) = element pause, (CP) =character pause and (WP) = word pause
S O S
dit dit dit dah dah dah dit dit dit
dit (EP) dit (EP) dit (CP) dah dah dah (CP) dit (EP) dit (EP) dit (WP) dit (EP) dit (EP) dit (CP) dah dah dah (CP) dit (EP) dit (EP) dit
The subroutines are for each of the individual elements..... Dit, Dah, Element pause, Character pause, and word pause. Then the subroutines are called as necessary. Now the output pin 1 was probably used to key a relay via a transistor driver that operated the radio.
If you are actually trying to learn Morse Code, there are much better ways. Looking at the code written in dits and dahs is THE ABSOLUTE WORST way to learn the code for a number of reasons. Try the www.arrl.org website. or Google 'morse code'.
73 de KD5GKD
This project is going to flash a matrix of LED's that have replaced a bulb inside a colored dome, and will be used at hamfests to send code. This is only a grins and giggles project.
What I am trying to figure out is how it converts the DEC 20 into a V. It is not obvious in the code, and I do not understand enough of this yet.
Thanks
Jason
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sick and tired of our media and the cheesy radio DJ's in the US? http://www.opieandanthony.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 7/19/2005 2:58:44 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sick and tired of our media and the cheesy radio DJ's in the US? http://www.opieandanthony.com
I am a little puzzled why I can't move subroutines around, but that will come in time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sick and tired of our media and the cheesy radio DJ's in the US? http://www.opieandanthony.com
Paul got it the first time. Hope this visual helps.
Bit #················ 7···· 6···· 5··· 4··· 3·· 2·· 1·· 0
bit value········· 128·· 64·· 32·· 16·· 8·· 4·· 2·· 1
B···················· 1···· 0···· 0··· 0·····0···1·· 0··· 0················ = 132
E···················· ·0··· 0···· 0··· 0··· 0····0·· 0··· 1················ = 1
A······················0····1···· 0··· 0··· 0··· 0··· 1··· 0··············· = 66
C····················· 1··· O···· 1··· 0··· 0··· 1··· 0··· 0··············· = 164
O····················· 1···· 1···· 1··· 0··· 0··· 0··· 1··· 1············· = 227
N····················· 1····· 0····0···· 0··· 0··· 0··· 1··· 0············ = 130
This is just a visual of what Paul was saying. The upper 5 bits represent the character in dahs ( 1 )·and dits ( 0 ) and the lower three bytes represent the number of elements in character b= 1 000 + 0100 or Dah dit dit dit ( an "extra" or unused bit) + the lower bits 0100 telling the subroutine that there are 4 elements in the character. It's a much more elegant method than what I used. Hope this helps.
Then declare
·If you define all of the morse charactors, creating lookup strings·is an easier task.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Very out of the box!
Thank You for your help, gentlemen. It would have been a long time before I understood it. I will let you know how the "drinking light" project comes along.
If anyone makes it to Hosstraders hamfest here in NH, let me know.
Jason
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sick and tired of our media and the cheesy radio DJ's in the US? http://www.opieandanthony.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
It's really bloated, but at least it now has comments. The fluff and the constants can be axed if the space is critical.
Now to figure out the best way to build LED replacements for the bulbs, and to find a good price on white LED's.
In the 2nd version of the hardware I want to have chasing rows or columns. If I REALLY get ambitious, a matrix so I can scroll letters.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sick and tired of our media and the cheesy radio DJ's in the US? http://www.opieandanthony.com