Shop OBEX P1 Docs P2 Docs Learn Events
Serial Port Question — Parallax Forums

Serial Port Question

Tom PTom P Posts: 97
edited 2008-05-04 15:51 in BASIC Stamp
Attention all Stampers
I'am trying to to send data from one (1)STAMPII to another (2)STAMPII via radio.
Once the data is received via SERIN on (2)STAMPII -- I want to send out the same data via SEROUT on another pin.
Question-- Can a STAMPII receive and then retransmitt data out another port at 2400 baud?
Does the data have to be buffered from SERIN to SEROUT. Can this be achieved using the STAMP II
Would this be a form of·full duplex or serial mirroring?
This serial port stuff seems complex!
Thanks
Tom

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-03 21:56
    A Stamp can receive then retransmit data at 2400 Baud. It's limited by the amount of variable space available for a buffer. It cannot receive while it's retransmitting because Stamps are "single-threaded". They can only do one thing at a time.

    Most of the larger / faster Stamps have what's called "scratchpad RAM" of 62 or 126 bytes which can be used as a buffer as well.

    Full duplex means that the device can receive and transmit at the same time. Stamps can't do this without an external buffer co-processor.
  • Tom PTom P Posts: 97
    edited 2008-05-04 15:31
    Followup questions
    What STAMP microconroller could be used that has a scratchpad RAM?
    What would an example program look like like that would take data in via SERIN and then buffer it and retransmitt it via SEROUT?
    Has anyone done this, who might give me some assisitance.
    Any help would be appreciated
    Tom
  • tpw_mantpw_man Posts: 276
    edited 2008-05-04 15:51
    The BS2e, BS2sx, BS2p24, BS2p40, BS2pe, and BS2px all have scratch pad ram. The BS2e and BS2sx have 62 bytes of SPRAM, while the others have 126 bytes. An example program would probably look like this, but I have not done serial echoing on the basic stamp before.


    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    buffer VAR BYTE(8)
    
    DO
    SERIN <pin>, <baud>, [noparse][[/noparse]STR buffer \8]
    SEROUT <pin>, <baud>, [noparse][[/noparse]STR buffer \8]
    LOOP
    
    [i]Replace <pin> and <baud> with the desired baudrate and pin.[/i]
    
    
    



    Hope this helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I am 1011, so be surprised!
Sign In or Register to comment.