Shop OBEX P1 Docs P2 Docs Learn Events
2 serial ports — Parallax Forums

2 serial ports

dk_akjdk_akj Posts: 37
edited 2004-08-04 23:21 in BASIC Stamp
Hi.

I'll use a STAMP to communicate with a modem (2 way comm)

In the development fase·I need to debug the program.
How can I connect both my pc and the modem to the STAMP on the same time ??


This link shows shows a modem and a gps connected but it seems as it is only one way comm(STAMP to GSM and·GPS to STAMP).
http://www.parallax.com/html_pages/resources/custapps/app_gps_track.asp.

Thanks in advance
Anders

Comments

  • GadgetmanGadgetman Posts: 2,436
    edited 2004-08-04 10:24
    Use a MAX232 or similar line driver chip to convert the logic levels on another set of pins and connect the modem to that.
    (And change the pin assignment in the SEROUT/SERIN commands accordingly)
  • dk_akjdk_akj Posts: 37
    edited 2004-08-04 12:03
    Ok, if I understand you correct I can simply connect a MAX232 chip to eg. pin 0 and 1 and in my program simply use this as port #2 ??

    Regards
    Anders
  • GadgetmanGadgetman Posts: 2,436
    edited 2004-08-04 12:51
    That would be the theory, yes.
    ·
  • AlWilliamsAWCAlWilliamsAWC Posts: 135
    edited 2004-08-04 13:05
    Yes, the Stamp can use any two pins as another serial port (see http://www.awce.com/rs1.htm for a handy way to do this or http://www.awce.com/asp3.htm for a board with a programming port and an extra serial port). However, keep in mind that if you plan on using both serial ports at once, that neither will be listening when you are doing something else and that listening to port "A" means you are not listening on port "B" and vice versa. There is no bufferring. If you aren't listening, you are losing data unless you've arranged for the other device to not send until you are listening (hardware handshaking or some software protocol).

    Regards,

    Al Williams
    AWC
    Kits!
    http://www.awce.com/kits.htm
    ·
  • Tom WalkerTom Walker Posts: 509
    edited 2004-08-04 13:20
    Maybe I'm mis-reading the original post, but it sounds like you're trying to connect both devices (modem and PC) to the same pin at the same time for debugging. Am I interpreting your request correctly?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I used to be different, but now I'm the same...
  • dk_akjdk_akj Posts: 37
    edited 2004-08-04 14:12
    Tom Walker said...
    Maybe I'm mis-reading the original post, but it sounds like you're trying to connect both devices (modem and PC) to the same pin at the same time for debugging. Am I interpreting your request correctly?

    Tom,

    I want, during development,·to be able to se "status" of my program while the STAMP is connected and communicating with the modem.

    I do not want to use the same pins.

    Regards
    Anders
  • K de JongK de Jong Posts: 154
    edited 2004-08-04 19:43
    Another solution could be to display the status information from your program on an LCD.

    Just to give the discussion another impuls smile.gif.

    Klaus
  • dk_akjdk_akj Posts: 37
    edited 2004-08-04 20:00
    Klaus,

    Good id
  • K de JongK de Jong Posts: 154
    edited 2004-08-04 23:21
    Well Anders,

    A problem with this 'good idea' can be that you still need a serial connection to program your Stamp. I have solved this in the past by putting a mechanical dual pole switch to change Tx and Rx lines as needed.

    I have a Stampboard with an LCD which I use for testing serial connections and sensors or actuators mainly. Very handy when I have to look at two signals 'simultanious' or when there is no computer available. This board can also 'beep' so I don't even have to look at the display to know what's going on smile.gif.

    Klaus
Sign In or Register to comment.