Hello Foxx,
Foxx>>I kinda get a little bit of how you did that whol thing, but im still a little fuzzy on the Vs Vl stuff. But i can see why you would wanna do it that way. honestly, i was trying to think of a way to do it like you did, but like i said, i am a total PicBASIC newbie.<<
First things first...I wrote everything in Psuedo Code, because I am here at work. It is not EXACT code.
Lets look at a idea on how to receive the code.
Loop:
Receive tone
if too long of a pause, goto lookuptable
distinguish the tone value
store the tone in a variable
goto Loop
Lookuptable:
Take your variable, compare to a value
in the program or table and output
Goto Loop
*******************
Storing that "tone" in a variable is Vs and Vl
How are you going to distinguish the difference between the following:
__
__ __
__ __ __
and distingiush the following from above?
.
..
...
Using 1's and 0's can do it, but if they are used in just one 8 bit variable, you cannot distinguish the differences between the shorts and longs (marks and spaces). You have no place to start or stop through the entire 5 bits of data, because the whole 5 bits of data are exactly the same. to overcome this, you can use 2 variables that are 8 bit. (Vs and Vl) Vs will keep track of the shorts and Vl can keep track of the long. Both of them together will give the exact representation of the character coming across the signal.
For example the letters T,M,O represented by only one variable would look like this: (using 1 as short and 0 as long).
T = 00000000
M= 00000000
O= 00000000
On a lookup table, how are you going to represent 3 letters that are exactly alike?? they are all zeros! If you attempt to assign 1's to the long and 0 to the shorts, it looks like this:
T= 00000001
M= 00000011
O= 00000111
this is Good! but it poses another problem, how about characters that are the short sounds? Like E, I, and s?
E=00000000
I=00000000
S=0000000
Either side of the coin, using just one 8 bit variable is going to byte you in the 6 oclock. Now, lets introduce Vs and Vl.
T=__
Vs=%00000000 'there are no short tones
Vl= %00000001 'there is one high tone
$00,$01
0=__ __ __
Vs=%00000000 'there are no short tones
Vl= %00000111 'there are 3 long or high tones.
and if you go the opposite way (Lets take e and I)
e = .
Vs=%00000001
Vl=%00000000
$01,00
I= . .
Vs=%00000011
Vl =%00000000
$03,$00.
Thus "E" and "O" have a value that are NOT the same, and LIKE characters have a different value too.
Now you use a lookup table, or case statement, or IF statements.
if VSVL==$0300 then print out on LCD "I"
if VSVL==$0100 then print out on LCD "E"
if VSVL==$0003 then print out on LCD "M"
...
...
Sorry if this sounds confusing. I will try again.
Anyhow, first things first...
"Distinguishing the tones" Using PULSIN can give you how long your in the positive or negative stage of a wave. If you have this value, you can calculate the frequency of the wave, assign it a mark or space (short or long, or 1 and 0)
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks