Shop OBEX P1 Docs P2 Docs Learn Events
BS2SX serial port and a Dell Laptop — Parallax Forums

BS2SX serial port and a Dell Laptop

okc.engineerokc.engineer Posts: 12
edited 2005-01-18 01:32 in BASIC Stamp
Hi there,

Being a stamp newbie, I don't know how to solve this problem.· My company builds a product based on the BS2SX, and the firmware includes several commands that require communication with a terminal.· Since the stamp does not utilize the normal RS232 standard voltage levels, I can't seem to get it to communicate with my Dell D800 Laptop.· It works fine with my older desktop computer, and it seems to work fine on my boss's older Dell laptop, but no luck with my new laptop.

One of the things I have tried was placing a 10k pull-up resistor on the RS232 SOUT pin (1) and pull it up to the 12 volt level.· For communication this works fine, but when the RS232 plug is disconnected, the stamp appears to shut down.· The same thing happens if I connect the resistor to the SIN pin (2).

Does this mean I am going to have to use a level translator to get this to work with my Laptop?

Thanks!
Bill

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2005-01-13 22:21
    Are you using all the rs232 pins?

    Or have you built your own custom cable and using tx/rx and gnd.

    A couple years ago I ran in to a problem (non-stamp related) with interfacing to a piece of gear.
    The cable I had initially made used rx/tx and gnd.· (pins 2&3 and pin7 for gnd).·
    This worked on an old laptop I was using....but when I upgraded to a new laptop it no longer worked.
    Well, I wasn't happy!· And these were proper rs232 levels.
    But I found that the pin7 I was using was a chassis ground and not the signal ground of pin5.
    So that's my first tip is to be sure you're using a proper ground!

    level translators are easy to use.· The MAX232CPE is one IC and 5caps...But, you can buy the MAX232 with the caps already in them (don't know the product code).



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-13 23:09
    If your device is using the Sout and Sin pins on the BASIC Stamp module you shouldn't need any assistance. If, however, the device uses standard IO pins (P0-P15) then a level-shifter may be required.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • okc.engineerokc.engineer Posts: 12
    edited 2005-01-14 14:53
    Thanks Steve and Jon,

    In this case I am using the main serial port SIN and SOUT, plus the ATN and VSSP pins. They are connected in this configuration:

    SOUT to DB9 pin 2
    SIN to DB9 pin 3
    ATN to DB9 pin 4
    VSSP (gnd) to DB9 pin 5

    pins 6 and 7 of DB9 are shorted together, and in this design pin 9 of DB9 is connected to +5.

    The cable I am using is a typical store-bought null-modem cable. What's interesting about this is that if I use a USB-to-serial adaptor, it works fine. It just won't work on the computer's direct-in serial port, unless I use a pull-up resistor.

    I was hoping I could find out what causes the stamp to stop working with the pullup resistor. If I could prevent that, I wouldn't have any problem.

    Should I assume that the computer's serial port is bad? Except I know that it works with other applications, just not this one.

    Most of my design and programming background is 8051-based, so I have almost no hardware knowledge of the basic stamp.

    Thanks again
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-14 15:25
    Umm, a "null-modem" cable swaps pins 2 and 3, and 6 and 7. The BS2 requires a "straight-through" cable. A Null-Modem cable will pass the echo and loopback tests, but none beyond that. If the cable works with a USB adapter, then probably the cable is NOT a 'null-modem' cable, so you're ok there.

    Some laptops don't actually implement the +-12 volt RS232 standard, so that could be part of your problem. It's good you've found a USB to Serial adapter that works.

    I don't think the pull-up on SIN is going to work, though.
  • okc.engineerokc.engineer Posts: 12
    edited 2005-01-14 16:22
    I apologize, I am mistaken about the cable. I use a null-modem cable on another project, this one is a straight-thru. Duh-h!

    Thanks for the information. It's disappointing to know that this expensive computer is not up to standard.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-14 20:13
    Note that some PC programs will manipulate DTR (which connects to ATN) in such a way as to cause the Stamp to reset.· The attached diagram should help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
    599 x 555 - 16K
  • okc.engineerokc.engineer Posts: 12
    edited 2005-01-14 22:42
    Thanks, I'll try this.... but will it still work when using the port to download the Basic Stamp program? I have no clue what the hardware does when the stamp is downloading.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-14 23:14
    Yes, the circuit above IS what we use for programming on our boards. The Stamp IDE knows how to "blip" the DTR line to cause the Stamp to reset so it can be reprogrammed. A steady state on that line, however, is "blocked" by the series cap.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • okc.engineerokc.engineer Posts: 12
    edited 2005-01-17 14:25
    Jon, so far, so good. I tacked in a couple of 0.1uF capacitors according to your diagram and first tests seem to show that everything is working well. Thanks!
  • okc.engineerokc.engineer Posts: 12
    edited 2005-01-17 15:10
    Well, now that I have a little better understanding of the way the Stamp utilizes the serial port, I have figured out that I can manually clear the DTR line on the terminal program I am using, and the system works fine. That means I can use the computer without having to make changes to the board or -- as was one of my other considerations -- make a special adaptor cable with the capacitors included.

    Thanks again Jon.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-18 01:32
    Well, we suggest the caps -- they're cheap and an easy way to prevent problems in the event you get a program where you cannot control the DTR line.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.