View previous topic :: View next topic |
Author |
Message |
node
Joined: 17 Feb 2005 Posts: 4
|
Posted: Fri Feb 18, 2005 2:04 pm Post subject: Morse Code Using Bascom AVR |
|
|
I recently bought a AVR 2313 Development board and LCD panel to learn AVR programming. I was told to start by learning programming using Bascom AVR.
The project I want to make is to program a AVR 2313 to convert TEXT into Morse Code (Dah & Dit). I want to take this AVR and put it in a circuit to work as a keyer for a Beacon.
This is what I want to do and build http://users3.ev1.net/~g4fre/keyers2.htm But using the AVR 2313 instead of a PIC 16C505
What I require, is someone to explain the process to go about doing this, in simple terms, from the start. I have the Bascom Demo software. |
|
Back to top |
|
|
ATIU
Joined: 15 Oct 2004 Posts: 534
|
Posted: Sat Feb 19, 2005 5:24 am Post subject: |
|
|
Convert the Text equivalent using the Qbasic program posted in the site, then with the hex equivalent, you can use a very short routine as follows
Config Portb.0 = Output
Dim I as byte
Dim X as byte
Main:
Restore Dta1
While X <> &HCC
Read X
For I = 7 to 0 step -1
Portb.0 = X.I
Waitms 300 'You may want to adjust this
Next I
End If
WEND
Wait 3600 'Wait for 1 hour for next signal out
X = 0
Goto Main
Dta1:
Data &HF4, &H23, &H10 ....... and so on end with &HCC
Port B.0 should pulse the equivalent morse codes, if you want it to be as tone, you may need to use PWM, which is beyond me right now. |
|
Back to top |
|
|
node
Joined: 17 Feb 2005 Posts: 4
|
Posted: Sun Feb 20, 2005 4:31 am Post subject: |
|
|
Thanks for the start. I will download the program and start with the project. I will keep you inform as to my progress.
Node |
|
Back to top |
|
|
superjan
Joined: 04 Nov 2005 Posts: 5
|
Posted: Fri Nov 04, 2005 9:55 pm Post subject: |
|
|
Hi,
This is my program that I made on a rainy day, just for fun.
Maybe you could do something with it.
Code: |
$regfile = "2313def.dat"
$crystal = 4000000
$baud = 9600
Config Portd.6 = Output
Reset Portd.6
Dim Code As String * 10 , Woord As String * 10
Dim Index As Byte , Lengte As Byte , Letter As String * 1
Dim Lengte2 As Byte , Index2 As Byte , Letter2 As String * 1
Do
Input "Woord met maximaal 10 karakters: " , Woord
Woord = Trim(woord)
Woord = Ucase(woord)
Lengte = Len(woord)
For Index = 1 To Lengte
Letter = Mid(woord , Index , 1)
Select Case Letter
Case "A" : Code = ".-"
Case "B" : Code = "-..."
Case "C" : Code = "-.-."
Case "D" : Code = "-.."
Case "E" : Code = "."
Case "F" : Code = "..-."
Case "G" : Code = "--."
Case "H" : Code = "...."
Case "I" : Code = ".."
Case "J" : Code = ".---"
Case "K" : Code = "-.-"
Case "L" : Code = ".-.."
Case "M" : Code = "--"
Case "N" : Code = "-."
Case "O" : Code = "---"
Case "P" : Code = ".--."
Case "Q" : Code = "--.-"
Case "R" : Code = ".-."
Case "S" : Code = "..."
Case "T" : Code = "-"
Case "U" : Code = "..-"
Case "V" : Code = "...-"
Case "W" : Code = ".--"
Case "X" : Code = "-..-"
Case "Y" : Code = "-.--"
Case "Z" : Code = "--.."
Case "0" : Code = "-----"
Case "1" : Code = ".----"
Case "2" : Code = "..---"
Case "3" : Code = "...--"
Case "4" : Code = "....-"
Case "5" : Code = "....."
Case "6" : Code = "-...."
Case "7" : Code = "--..."
Case "8" : Code = "---.."
Case "9" : Code = "----."
End Select
Lengte2 = Len(code)
For Index2 = 1 To Lengte2
Letter2 = Mid(code , Index2 , 1)
Waitms 50
If Letter2 = "-" Then
Set Portd.6
Waitms 150
Reset Portd.6
Elseif Letter2 = "." Then
Set Portd.6
Waitms 50
Reset Portd.6
End If
Next
Next
Loop |
|
|
Back to top |
|
|
va3to
Joined: 24 Apr 2004 Posts: 9 Location: near Niagara Falls, Canada
|
Posted: Fri Nov 04, 2005 11:38 pm Post subject: |
|
|
I built a CW beacon keyer using a 90s2313. You can program the message and the keying speed via RS-232 using a terminal program on your PC.
Have a look here: www.ilinkca.com and see if that will work for you.
73 de Hugh VA3TO |
|
Back to top |
|
|
|