TTY - Teletype Terminal


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Fox,

    Fox>>ok, im trying to figure out how to at least transmit the TTY tones... the only way i can think of doing it is using a crapload of If-Then statements. Kinda like this...


    IF key="A" THEN
    FREQOUT PORTB.1,40,1800
    FREQOUT PORTB.1,40,1800
    FREQOUT PORTB.1,40,1800
    FREQOUT PORTB.1,40,1400
    FREQOUT PORTB.1,40,1400
    end if


    then have the same for the rest of the characters. But i think it would be better to put whatever they keyboard data that comes by into memory, that way there is a buffer... but i have no idea how to do that.

    Any other suggestions on how to do this?
    <<

    Ouch...Lets think about this a second ok? There are a couple of options.
    It would be much better to represent your letters in a numeric or bionary form.
    Letting one tone be 1's and the other be zeros'. but that poses a slight problem, because how are you going to represent letters that have 3 of the same tones, verse 2 of the same tones? One way to do this, it to have representations of one tone in one variable, and representation of the other tone in another variable.

    Lets let one tone represent 1800hz and the other tone represent 2150hz ( I like thinking of it in "tones" instead of Mark,stop, space, and start bits.

    Lets look at Morse code (which the idea is similiar to Baudot, except it uses 6 possible bits to print out the ASCII characters that Hams use.

    T=_
    M=_ _
    O=_ _ _
    9=_ _ _ _.

    Notice the problem concerning the dashes or spaces? Using just a 1 and zero will not truely represent and differentiate between the characters.
    T=0
    M=00
    O=000
    9=00001
    which all 3 equate to zero and if you attempt to use 1's to present dashes, you run into the same problem using 0's to represent the "dits".

    One way to do such a thing, is the following: (letting 1 equate to dits)
    Vs Var byte (keeps track of the dits...shorts)
    Vl Var Byte (Keeps track of the dashes...long)

    T:
    Vs=%00000000
    Vl= %00000001
    $00,$01

    0:
    Vs=%00000000
    Vl= %00000111
    $00,$07

    Now, lets take a "complicated" character... Like the period. It is of 6 characters in Morse, and baudot is in 5... but the same principal applies
    .:
    .-.-.-

    Vs=%00101010
    Vl =%00010101
    $2A $15

    Now, with this in mind, we can play a game of receive/shift!

    Loop:
    Vs=0;
    Vl=0;
    counter=0;
    Loop2:
    receive tone
    if Tone length = correct (because you may have a 'pause')
    {
    (and a pause generates a tone!)
    (on some machines! )
    switch Tone

    case tone=low
    Vs[0]=1;
    Vl[0]=0;
    Vs<<1
    Vl<<1


    case tone=high

    Vs[0]=0;
    Vl[0]=1;
    Vs<<1
    Vl<<1

    endswitch
    counter =counter+1;
    }endif (counter less than 6)
    if counter<6 goto Loop2 (hey, get next tone!)
    if counter =6 then Loop1 (error, too many tones)
    }endif

    Vs, and VL have your data , you could combine them into 1 word if you want, instead of 2 separate bytes.

    Now you can do a couple of things from here... either a table lookup, or
    a if/case statement.

    switch VsVl
    case VsVl=$0007
    Print "O"
    case VsVl=$2A15
    Print "."

    etc. etc. etc.
    Last edited by Dwayne; - 10th March 2005 at 22:18. Reason: mistyped counter
    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...

  2. #2
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    See attachments.

    Oscilloscope picture of the transition SPACE to MARK. The signal is generated with the sound card and the SW CallTTY v. 1.10.

    Luciano
    Attached Images Attached Images  

  3. #3
    Foxx373's Avatar
    Foxx373 Guest


    Did you find this post helpful? Yes | No

    Default

    Damn Dwane, my head hurts now... I have no IDEA what the hell u said. 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.

  4. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    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...

  5. #5
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi Foxx373,

    I have collected (stolen) some material from the internet and
    created a poster that will help you during this project.

    (See attached file baudot.bmp , print=landscape).

    Best regards,

    Luciano


    The source of the original material is:

    async1.html, ©1998 All rights reserved
    Tampa Bay Interactive, Inc.
    Attached Images Attached Images  

  6. #6
    Join Date
    Jun 2014
    Posts
    1


    Did you find this post helpful? Yes | No

    Default Re: TTY - Teletype Terminal

    Hi Guys,
    i was just curious the outcome of your project as i am considering a similar project and was curious if you were successful?
    thanks

Similar Threads

  1. Key_in from terminal
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 25th May 2009, 16:15
  2. Hyper Terminal Setting for TTL putput
    By ClayE in forum Serial
    Replies: 6
    Last Post: - 7th June 2008, 06:50
  3. Tapping data from a Unix VT220 terminal
    By sougata in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd February 2006, 04:47
  4. what is hyper terminal?
    By moud_man in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th September 2005, 19:33
  5. USB Terminal
    By Normnet in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th April 2005, 11:51

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts