TTY - Teletype Terminal


Closed Thread
Results 1 to 27 of 27
  1. #1
    Foxx373's Avatar
    Foxx373 Guest

    Default TTY - Teletype Terminal

    I am new to PicBASIC, and im not too sure how to work this out right now, but i would liek to make a TTY Terminal. TTY is used by deaf people to place calls through a relay operator. TTY Terminals work by using the BAUDOT protocol. There is a set of tones that has to be decoded and turned into characters on an LCD display. Im sure i can figure out how to generate the tones, and place them on an LCD display, but how can i decode Multi-Frequency tones? Any ideas?

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    2-3 way... COUNT and PULSEIN. will return you some value to play with for low frequency. Or using interrupts to count exaclty the period of each frequency with internal TIMER/Counter.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Foxx373's Avatar
    Foxx373 Guest


    Did you find this post helpful? Yes | No

    Default

    Since TTY deals with soundwaves, i was thnking about using the on board Analog-Digital Converter. I just have no idea how to do that. im sure if i use the COUNT or PULSEIN command, i will have to take the sound coming from the headset, make it a digital signal with a simple op amp, or transistor based logic converter, then pass it to the designated input. Does this sound right?

    How do I use interrupts? Liek i said, im really new to PicBASIC, but not to programming.
    Last edited by Foxx373; - 23rd February 2005 at 18:42.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Since TTY deals with soundwaves, i was thnking about using the on board Analog-Digital Converter.
    without any external of frequency to voltage converter you'll not be able to do it. A/D converter return a valu that correspond to the voltage at a specific input.

    im sure if i use the COUNT or PULSEIN command, i will have to take the sound coming from the headset, make it a digital signal with a simple op amp, or transistor based logic converter, then pass it to the designated input. Does this sound right?
    depending of the signal amplitude, a simple capacitor with 2 resistor as voltage divider can do the job too. 10 cents solution
    OR if you want to feel very very safe, using a OP-AMP or Voltage comparator to make the signal as sqaure as a real TTL- CMOS can also be used... i'll prefer that one to avoid some probale odd interrupt causes.

    How do I use interrupts? Liek i said, im really new to PicBASIC, but not to programming.
    depending of your PIC look into your datasheet under INTCON register... If you want some code example using interrupt... there's a load of those in the forum. Do a search with interrupt will gives you a bit less result than SEROUT. BUT, i did one example for lamp-dimming. Using interrupt to synchronise on AC power line.

    Click Here
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    Hello Foxx,

    Fox>>I am new to PicBASIC, and im not too sure how to work this out right now, but i would liek to make a TTY Terminal. TTY is used by deaf people to place calls through a relay operator. TTY Terminals work by using the BAUDOT protocol. There is a set of tones that has to be decoded and turned into characters on an LCD display. Im sure i can figure out how to generate the tones, and place them on an LCD display, but how can i decode Multi-Frequency tones? Any ideas?<<

    Ah ha!...My area of field <g>. I was making these in the 1990's with Philips 752's. Then went through a bad divorce. Then 3 years later, ended up becoming deaf myself!

    A couple of things to remember.. TDD does not use Standard RITTY code. It also does not use standard 8/7 bit data exchange.

    I can't remember the exact "tones" it uses. You can use a chip to decode each of the tones (which I did) or possibly use your PIC with PULSE in and timeout. Or maybe use a interupt and measure the time between the pulses.
    If I remember correctly it is a 3 to 1 ration on tones.
    I used a Lookup Table for decoding of the bits.

    You will have a problem for decoding between the two tones. lets say we have the tones "descriminated".

    Using two bytes, you can "shift" the 5 charactoristics into the bytes.

    Dots var byte
    Dash var byte

    Loop:
    Dots =0;
    Dash=0;
    .....
    .....
    if Tone=true
    if(Tone=low)
    Dots[0]=1
    endif

    if(Tone=High)
    Dash[0]=1
    endif
    Dots<<1
    Dash<<1
    endif

    With this, you have the exact layout of the mark and stop of the 5 bits...representing the letters/numbers. How you look it up in the table is
    up to you...If you need help in this, maybe I can dig up some of my notes from 15 years ago, or give you some ideas to go on.

    One other thought...Most TDD operators can do standard ASCII from your computer. I use my computer modem at work to TDD to certain people.

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

  6. #6
    Foxx373's Avatar
    Foxx373 Guest


    Did you find this post helpful? Yes | No

    Default

    Thats some very helpful info! Thanks a million. I didnt realize there were TTY Tone Decoder chips. Do you have any info on those? I think it would just be easier for me to use the tone decoder chip and process the data through the PIC, instead of making the PIC do all the work. Trying to "Descriminate" the audio levels are gonna be a bit unreliable. I am aware that a computer can be used to dial-in to the Relay Service, but a phone line isnt always available, and all that can be found is a payphone headset.

    Also, any ideas on what i can do about a small keyboard? Ive seen really cheap palm keyboards for 15 bux, think that can be used on a PIC? I would like this thing to be as small as possible, so no full AT keyboards... hummm... unless i build the terminal INTO the keyboard...

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


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Maybe you can use these for debugging purpose.


    * * *

    CallTTY 1.10
    (See software and schematics)
    http://www.dxsoft.com/en/products/calltty/

    * * *

    The tool TTY Angel:

    Manual:
    http://www.ciscounitytools.com/HelpFiles/TTYAngel.htm
    Download:
    http://www.ciscounitytools.com/App_TTYAngel.htm

    * * *

    ActiveX Controls.

    (See Online doc and Trial copy download).

    http://www.tapiex.com/ToneEncoder.htm
    http://www.tapiex.com/PhoneToneDecoder.htm


    * * *


    Best regards,

    Luciano

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


    Did you find this post helpful? Yes | No

    Default

    More info.

    Best regards,

    Luciano

    ===========================================

    Telecommunications devices for the deaf:

    http://www.tutorgig.com/ed/Telecommu...e_for_the_Deaf

    Original TDD devices were called TTYs, derived from teletype, and was
    invented by deaf-physicist Robert Weitbrecht in 1964. Communications
    was through frequency key shifting and single tone, allowing only
    one-way (simplex) communication at once. During the mid- 1970s, portable
    TTYs were developed and was also the time period when the term "TDD" began
    being used, largely by those outside the deaf community. The deaf
    community, interestingly, does not usually use the
    term "TDD", but instead prefer "TTY".

    The original standard used by TDDs is the Baudot code implemented
    asynchronously at either 45.5 or 50 baud, 1 start bit, 5 data bits,
    and 1.5 stop bits. The TDD/TTY standard is generally incompatible
    with standard Hayes-compatible modems. In 1994 the ITU approved
    the V.18 standard, an ASCII full- or half-duplex modulation method
    which has been widely adopted. Computers can, with appropriate software
    and modem, emulate a V.18 TDD. Some voice modems, coupled with
    appropriate software, can now be converted to TDD modems by using a
    software-based decoder for TDD tones.

    * * *

    TTY FAQ:

    http://www.deafweb.org/tty_faq.htm

    * * *

    ===========================================

    The V.18 standard

    The V.18 standard gives specifications for the
    implementation of text telephones, more commonly
    called TDDs (Telecommunications Devices for the Deaf).


    http://www.dinf.ne.jp/doc/english/Us...96/page169.htm

    http://tap.gallaudet.edu/v18.htm


    ITU Recommendation V.18 specifies interworking with
    the following TTY protocols:

    Baudot @ 45.45 baud (U.S. TTYs).

    Baudot @ 50 baud (used in England, Australia, and some other
    countries; also known as "international" Baudot).

    V.21/text telephone version (used in Sweden, Norway, and Finland).

    DTMF (used in Denmark, Holland, and some other countries).

    EDT ("European Deaf Telephone," used in Germany, Austria,
    Switzerland, and several other countries).

    * * *

    TWO DSP SOCKET MODEM with V.18 Standard

    (Ask which TTY protocols are supported in their implementation of V.18).


    MODULATIONS of the DSP SOCKET MODEM:

    V.90 (server and client), V.34bis, V.34, V.33, V.32bis, V.32,
    V.29, V.22bis, V.22, V22fast (HYPERCOM compatible), V.23,
    V.21, V.18, Bell 212A, Bell 103


    DSP SOCKET MODEM - SERIAL
    http://www.telindusproducts.com/Tap/...ocketmodem.pdf

    DSP SOCKET MODEM - PARALLEL
    http://www.telindusproducts.com/Tap/...emparallel.pdf

    ===========================================

    Radio Teletype (RTTY)

    I am not an expert but RTTY and TTY/TDD are close.
    Maybe you can use ideas from Amateur Radio RTTY circuits.
    (If you use only the Baudot code at speed 45.45 for your project).

    Both TDD and RTTY use five level Baudot/Murray code.
    Baudot table:
    http://burks.brighton.ac.uk/burks/foldoc/76/10.htm


    The first difference I can see:

    In TTY/TDD the “mark” tic is defined as 1400 Hz and
    the “space” tic is defined as 1800 Hz.
    See: "The Protocol Today"
    http://www.ciscounitytools.com/HelpFiles/TTYAngel.htm


    In RTTY the mark frequency is 2125Hz and the space is 2275Hz.
    RTTY is commonly transmitted at speeds of 45.5 bits per second.
    RTTY is either transmitted in Baudot or ASCII code.
    http://www.roity.com/rc/rtty.html


    ===========================================


    TDD devices:

    Non-Printing TTYs:
    http://www.phone-tty.com/PRODUCTS/OLD_PAGES/TTYs.htm

    PocketComm the POCKET TTY:
    http://www.krowntty.com/html/products/pocketcomm.html

    ===========================================

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


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Tone Generator and Tone Decoder Integrated Circuits.

    ================================================== ======

    The XR2206 and XR2211 are a versatile pair when it comes to modem building.
    Their advantage is that they may be set to what ever Mark and Space tones
    you like, creating the tone shift desired.


    Example of aplication:

    http://www.klm-tech.com/technicothica/xr.html


    Manufacturer:

    Exar Corporation,
    Fremont California,
    U.S.A.
    http://www.exar.com


    Where to buy:

    http://www.jameco.com

    XR2211 IC = Jameco #: 34999 USD 1.79
    XR2206 IC = Jameco #: 34972 USD 3.59


    Best regards,

    Luciano

  10. #10
    Foxx373's Avatar
    Foxx373 Guest


    Did you find this post helpful? Yes | No

    Default

    Everyone, thank you for your help. You have all done WAY more than ever expected. You have practically handed me all the data I would have ever need. Even though I allready know a great deal of TTY, I really admire all of you for your outstanding efforts in helping me with this project. Im glad to see that there are still people arround thats willing to go above and beyond the expectations from a call for help. With all that said, let me tell you what i have been cooking up.

    I had to find a replacement for the XR Encoder/Decoder. It works the same, just different passive components. I will try and use the NJM-2211 ( http://www.njr.co.jp/pdf/be/be06008.pdf ) for the CODECs. I would try and use the simple socket modem stated in earlier posts, but i have dealt with that modem before and for a simple project as TTY (heh... SIMPLE he says) the modem is too costly, and it way more powerful than whats needed. Im trying to keep this project simple, and inexpensive. As for a keyboard, i will probabbly just use a Mini-AT 86 Key keyboard i have laying arround. Im going to try and use an old 4x16 green LCD that has been sitting arround.
    Im going to try and use parallel LCD functions if i can for now. I dont want to build a Serial LCD Backpack and make this project more expensive, but i will if i have to.

    Im still a little dazed and confused on how im going to code this. This is going to be my 1st PIC project. I know im jumping into the deep end on this project, and I am way over my head, but im sure I can figure this out.

    As for a simple hardware layout, this is what i have in mind

    [Headset]-[LM 386 OP Amp]-[FSK En/DeCoder]-[PIC]-[LCD+Keyboard]

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


    Did you find this post helpful? Yes | No

    Default

    Hello Foxx,

    Foxx>>Im still a little dazed and confused on how im going to code this. This is going to be my 1st PIC project. I know im jumping into the deep end on this project, and I am way over my head, but im sure I can figure this out.

    As for a simple hardware layout, this is what i have in mind

    [Headset]-[LM 386 OP Amp]-[FSK En/DeCoder]-[PIC]-[LCD+Keyboard]<<

    Looks good!...If you have a scope, it will make tuning a little easier <g> if you are in the USA, I may be able to help you. if you have a telephone recorder, I could call and send some "A"'s and B's and other letters over my TDD (tty), so that you may verify and "smoothout" your reception.

    Audios! and good luck.

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

  12. #12
    Foxx373's Avatar
    Foxx373 Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks, ill keep that in mind. I have some TTY Apps for the PC, and I have a program that can make a *.WAV of TTY messages. Ive also recorded some TTY tones a few years ago.

    Im going to see what i can do about piecing the hardware together, and get started on the software. I was hoping to have a scroll back buffer, but I dont know how to do that yet...

    I dont have an O-Scope, but i do have Frequency function on my Multimeter. I do have a chunk of software that lets me use my PC as a simple sound-based O-Scope.

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


    Did you find this post helpful? Yes | No

    Default

    Hi,

    About sound card as Digital Oscilloscope.

    If your sound card is embedded in the motherboard then put
    a second sound Card in the PCI bus and use it as Oscilloscope.
    (It is very easy to burn your sound card when trying to
    investigate some signal with unknown amplitude and DC offset).

    Need more than 20 Hz to 20 kHz bandwidth?

    Virtins Sound Card Oscilloscope
    Bandwidth: 20 Hz - 96 kHz (depending on Sound Card)
    US$24.95, 7 day evaluation time.
    http://www.virtins.com/page2.html#Oscilloscope

    * * *
    SEE "Sound card input protection circuit":
    (Scroll down the web page).
    http://www.virtins.com/
    * * *
    Sound Card Interface For PC Test Instruments:
    (Full schematic and description + PDF files,
    the web server is sometimes busy).
    http://www.siliconchip.com.au/cms/A_30518/article.html
    * * *
    Example of Sound Card 96 kHz:
    (Ask Virtins Technology if OK with the SW).
    CREATIVE SOUND BLASTER LIVE 24-BIT
    Sound card - 24-bit - 96 kHz - 7.1 - PCI
    Where you can buy it:
    http://www.cdw.com
    CDW# 713157 US$30.43

    Please add your location in your forum profile.
    (Example "USA" or "IL, USA" or "Vernon Hills, IL, USA").
    If you do that I know which URLs are appropriate when I
    send you a link where to buy HW/SW.

    Best regards,

    Luciano
    Last edited by Luciano; - 3rd March 2005 at 10:58.

  14. #14
    Foxx373's Avatar
    Foxx373 Guest


    Did you find this post helpful? Yes | No

    Default

    Hi everyone,

    I havent written any code fr this project yet. I am trying to figre out the easiest way to implement and deal with this project. Im also having a lot of trouble finding the time to hunt down resources. Here is what ive been trying to do...

    I have decided to try and use only one PIC if possible, perhaps a 16F84. I will try and use a Hitatchi based LCD in 4 bit mode. I will have 2 pins for the TTY Encode/Decode features. I want to try and use a small PS/2 keyboard as the input. That will need 2 I/O pins (data and clock). I have to figure out how to clock the keyboard with the PIC, take the keyboard data, process it into 5 BIT ASCII (baudot format) and have the PIC use a lookup table to generate the proper "deedles" for TTY, or pass the 5 bit data to a TTY encoder chip.

    I am concerned about the speed of the PIC. Will the pic be able to keep up? It will need to use a few lookup tables to convert the PS/2 Data into 5 bit and make it TTY Format, then take the data from the TTY Decoder, pass it through a lookup table, then convert it to 4-Bit LCD data. I am also worried about typing too fast for the little guy. TTY Terminals dont send the data very fast, i can out type most terminals now. What will happen to the PIC? Will it have a "queue" by default, or will i have to tell the program to store what i type into memory? What about a scrollback buffer? I was hoping to add a simple SPI Serial memory of some kind that i can use to save the conversations to, then use HyperTerminal to download them... if possiblle.

    Any advice and code samples on lookup tables, memory access, "scroll buffer", how to interface an AT keyboard and data conversions would be nice. Again, thanks for taking the time to help me.
    Last edited by Foxx373; - 6th March 2005 at 10:58.

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


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Use a microcontroller with large flash memory and SRAM.
    (The 16F84 should be considered obsolete).

    Start with the decoder part HW and SW.
    (Receiving data is the difficult part of this project).


    1. Using the PC freeware, generate the TTY/TDD tones with
    the PC sound card at 45.45 bps. (Baudot @ 45.45 baud = U.S. TTY/TDD).

    2. Decode the TTY/TDD tones from the PC with your HW decoder chip.
    (Example of decoder chip: XR2211, Exar Corporation).

    3. With the microcontroller take the output of the decoder chip
    and display the data in ASCII format on the LCD.

    Best regards,

    Luciano

  16. #16
    Foxx373's Avatar
    Foxx373 Guest


    Did you find this post helpful? Yes | No

    Default

    Thats a good idea. I was trying to tackle this project head on. I guess breaking it down piece by piece and getting each part to to work first is the key. Im not too familliar with the PIC MCUs. Any advice on which one to use? The 16F87 perhaps?
    Last edited by Foxx373; - 8th March 2005 at 07:51.

  17. #17
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    PIC16F628 or 16F88 could be great ones to start.

    PIC16F819, 16F877 are also really popular
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  18. #18
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    @ Dwayne

    isn't this something we are "already" working on ?

    ;-)
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  19. #19
    Foxx373's Avatar
    Foxx373 Guest


    Did you find this post helpful? Yes | No

    Default

    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?

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


    Did you find this post helpful? Yes | No

    Default

    Hi,

    The standard used by TDDs is the Baudot code implemented
    asynchronously at 45.5 (USA), 1 start bit, 5 data bits,
    and 1.5 stop bits.

    In your example I see only the 5 data bits.

    From the PBP manual:

    FREQOUT generates tones using a form of pulse width modulation.
    The raw data coming out of the pin looks pretty scary. Some kind
    of filter is usually necessary to smooth the signal to a sine
    wave get rid of some of the harmonics that are generated.

    * * *

    Two questions when you use the FREQOUT command + filter:

    1. What happen during transitions with the output signal?
    2. Is the the output phase-continuous during transitions?

    The output of the sinusoidal FSK Generator has to be
    phase-continuous during transitions.(Mark and space transitions).

    See page 2 of this PDF for Frequency shift keying (FSK) signal.
    http://www.cs.sfu.ca/CourseCentral/3...s/lecture7.pdf

    * * *

    What about using the HW tone generator XR 2206 from Exar Corporation?
    (The input for the tone generator XR 2206 is serial data).

    XR-2206 monolithic function generator
    Datasheet Rev 1.03
    http://www.exar.com/products/XR2206v103.pdf

    Page 9

    FSK Generation
    Figure 13 shows the circuit connection for sinusoidal FSK
    signal operation. Mark and space frequencies can be
    independently adjusted by the choice of timing resistors,
    R1 and R2; the output is phase-continuous during
    transitions. The keying signal is applied to Pin 9.


    Again, start with the decoder part of your project.
    The encoder part is easy.

    Best regards,

    Luciano

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


    Did you find this post helpful? Yes | No

    Default

    Hello Ralph,

    Ralph>>@ Dwayne

    isn't this something we are "already" working on ?<<

    <chuckle> Yep... I was working more on letting the PIC do all the work, instead of using PLL chips to detect the tones like I did in 1990.

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

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

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

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

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

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

  27. #27
    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 : 1

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