Shop OBEX P1 Docs P2 Docs Learn Events
TTL Terminal Emulator — Parallax Forums

TTL Terminal Emulator

aldajaaldaja Posts: 3
edited 2012-05-19 08:37 in Propeller 1
I have the deal extreme NAS (http://www.dealextreme.com/p/standalone-bittorrent-bt-client-usb-nas-ftp-samba-printer-upnp-sharing-network-lan-server-26320) completely hacked out. I SSH into it and have it running as a file server and a media player through an USB sound card.

As always, I want to take this one step farther.

And to do that, I'll need to add a screen.

The easiest way I've found to do that is by using the built in TTL traces and connecting them to a micro controller. That micro controller will then take the signal and pump them out into composite video. Finally, a keyboard will be connected to the micro controller for input. A portable DVD player with a broken drive will act as the screen.

Only problem, I have no experience with the propeller.

Does anyone have any hints or resources to get me started on this project. I'm planning on writing the code and designing the board before I order anything.

Thanks

Comments

  • prof_brainoprof_braino Posts: 4,313
    edited 2012-04-27 05:51
    Welcome!

    You are at the start of a fun adventure.

    You can start with the Prop Demo Board, or Pro Dev board, or any board with VGA & PS/2, or use a stock proto board and add your own.

    Then find the VGA demos in the OBEX.

    Then start plunkin' alone and asking questions. Add each function in turn as you figure out them out, one by one, folks will help as you progress. There is a learning curve, but just wade in until you get deep enough to start swimming.
  • aldajaaldaja Posts: 3
    edited 2012-04-27 22:42
    So I've got the steps to do this sorted out. There's three parts to the code that need to be assembled into one program.

    1. TV out-this is documented tremendously and easy to find information on
    2. Keyboard support-Same as above
    3. TTL communication-I have found nothing

    So it looks like I'm swimming in a lake only I've discovered. On the Serial connection how to page for the NAS I'm given these settings to connect a computer program via serial cable to the little linux box:
    • Bits per second: 38400
    • Data bits: 8
    • Parity: None
    • Stop bits: 1
    Some of the things I'll probably need to find out is how the information from the box is sent through the cable and how I'll send back key presses to the box.

    After I assemble some sort of working code to read and transmit TTL from the propeller to the box I'll need to find a way to connect all the pieces.

    So I need help, and I feel like I've tried every google term I can think of.

    Oh and a picture of the computer I'm trying to add a head to:
    2012-04-28_00-37-19_407.jpg
    1024 x 576 - 65K
  • kwinnkwinn Posts: 8,697
    edited 2012-04-27 23:11
    The Full Duplex Serial object in the OBEX will take care of that function although you may need a buffer to convert the 3.3V signal from the prop to a 5V signal going to the NAS. You will also need a 3.3K resistor on the serial line from the NAS to the prop input pin to limit the current.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-04-28 01:29
    I suspect the easiest approach is to use a Propeller Demo board and install a 'dumb terminal' application to it. In your case, you could hook up direct TTL rather than an RS-232 level shifter.

    I use PocketTerminal firmware. It will save you a lot of time and effort in regards to messing with code. You may have to have some pull-up or pull-down resistors on your TTL lines to get proper behavior.

    http://forums.parallax.com/showthread.php?134866-PocketTerml-a-great-VGA-VT100-terminal-for-RS-232-and-RS-485

    http://www.brielcomputers.com/phpBB2/viewtopic.php?t=432

    http://www.brielcomputers.com <== Go HERE and then locate the Pocket Term in products and you have 3 downloads. They may have discontinued selling boards, but the firmware is in Spin and very easily adapted to a Propeller Proto Board. I have a dedicated unit set up as an RS-232 VT-100 'dumb terminal' for all sorts of projects.

    There are lots of ways to shift from 3.3v to 5v TTL. I suspect the easiest is just to use a chip that is powered by +5 and provides TLL level logic from +3.3 input. "The Art of Electronics" by Horowitz has a whole section on how to best do these type of connections.

    BTW, the fact that you have NO Parity bits makes the whole thing a lot easier. Parity verification adds a whole additional step to creating good code.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-04-28 01:48
    As kwinn says your serial is just another object
    Bits per second: 38400
    Data bits: 8
    Parity: None
    Stop bits: 1

    It will easily work at that speed.

    RS232 can be a little complicated. There is proper RS232, where a resting voltage is -12V and a data bit is +12V (technically anything under -3V or over +3V). And then there is "TTL" RS232 which is resting 5V, and data is 0V. Or it might be resting 3.3V and data is 0V.

    Because TTL serial might have a different resting voltage, and pins on chips don't like being shorted, and don't like having 25V put on them etc etc. the standard answer is to use a converter chip. MAX232 for 5V TTL to RS232, and MAX3232 for 3V TTL to RS232.

    I tend to convert to proper RS232 and then back again, even when sending data a few feet, because RS232 is more robust - you can short pins, connect two outputs to each other, reverse the polarity etc and the MAX chips can handle it.

    I've also tried to standardise all my RS232 connections so they have D9 plugs and sockets. You only need to connect three pins generally - pin 5 for gnd, and pins 2 and 3 for data Tx and Rx.
    by using the built in TTL traces and connecting them to a micro controller

    If you take those traces and run them through a max232 or max3232 and into a D9, then you can get a $1 USB to serial adapter off ebay and send that data into a terminal program on your PC. This makes it much easier debugging.

    On the prop side, you can also add a max converter.

    BUT - you might be able to cheat too. A 2k7 resistor will replace those two maxim chips as it will act as a 3V to 5V interface in both directions and if your board happens to run at 3V it won't matter having that resistor in place.
  • prof_brainoprof_braino Posts: 4,313
    edited 2012-04-28 06:20
    If you want to see an example terminal emulator for the demoboard, check the link below

    http://code.google.com/p/propforth/downloads/detail?name=PropForth3.5e-20101019.zip&can=1&q=zip

    The link is an deprecated version of propforth, the code has not been brought forward to the current version but we plan to shortly.

    It allows a terminal communications using the demo board as display and keyboard (no mouse, too lazy) and communicates over the USB serial line. It was intended to be a stand-alone development environment, but can be used as a terminal.

    Find the material called JupiterACE and install it, your good to go.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-04-29 00:59
    Converting to 'proper RS232' voltages of +12 and -12 seems quite unnecessary to me unless there are some significant distances involved. And even then, if you need distance, it is much easier to use RS 422/485 drivers and recievers - probably cheaper too as you don't have to create or provide + and - voltages.

    If TTL is what he needs, he can work directly with TTL - but has to accept resonsibility for potential damage to chips directly involved due to wiring errors and shorts or provide some sort of buffering component (transistors, mosfets, or chips).

    LS7404 and LS7407 chips may be just fine for protection and conversion from 3.3v to 5v on the Propeller side. Of course, the other side might need something to protect it as well. Going down from +5 to +3.3 cam be achieved by insertion of an appropriate resistor or a small diode inorder to drop the voltage. These chips and components would take any external abuses and be sacraficed rather than the microcontrollers involved.

    Even Parallax doesn't bother with 'standard +12/-12 RS232' and drives the Basic Stamp interfaces with 0 to 5v via a few cheap transistors and resistors. Most laptops don't or didn't go above 9 volts in their RS232.

    The RS-232 standard specification is rather obsolete due to requiring that +12/-12 and most major manufacturers had found ways to comply with something less. It has been pretty much abandoned in favor of USB or RS-422/485. The RS-422/485 only requires +3.3v or +5 and can be driven faster and farther.
  • kwinnkwinn Posts: 8,697
    edited 2012-04-29 11:17
    IIRC the latest RS232 standard was RS232C and it specified a voltage between +- 3 to 12 V. Still needs a negative voltage which is a nuisance that can be avoided by using RS422/485.

    In aldaja's case it sounded like he wanted to mount the screen in the same housing as the NAS board he hacked so TTL levels should work just fine provided he puts a 3.3K resistor between the NAS serial output and the Propeller input pin. I also put a 220 ohm resistor between the prop output pin and the TTL input even though it is not really required. I consider that cheap insurance in case that line gets shorted to ground.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-04-30 07:32
    The below link explains the use of logic chips for going from 3.3v to 5v

    http://forums.parallax.com/showthread.php?127018-Translator-Chips-from-prop-to-5v-ttl-cmos

    And going from 5v to 3.3v

    http://forums.parallax.com/showthread.php?127018-Translator-Chips-from-prop-to-5v-ttl-cmos

    You may search for other solutions, many have been discovered and work. Bi-directional is more sophisticated.
  • aldajaaldaja Posts: 3
    edited 2012-05-18 20:12
    Sorry for bringing up an old thread etc etc... but I found out the propeller is way to over powered and expensive for what I want to do. Using some creative googleing I found this:

    http://www.serasidis.gr/circuits/TV_terminal/Small_TV_terminal.htm

    And I'm waiting for the parts to arrive and am planning on using my arduino as an ISP.

    Thanks for the help anyway.
  • prof_brainoprof_braino Posts: 4,313
    edited 2012-05-19 08:37
    Thats a good way to do it. Especially if you already have the arduino on you desk, and you plan to dedicate it to a final project.

    Most of the folks here have a prop on the work bench, I have a prop demoboard and its already built with all hardware support for vga, tv, keyboard and mouse. So many of us would start with the prop, and save the cost of the arduino, circuit board, and assembly time. Same thing, but from a different starting point. For what you're doing, one probably do all of it on the prop, and still have room to build. In fact, that looks like it might be a good idea too.

    Keep us posted with your results, it looks like a cool hack!
Sign In or Register to comment.