Shop OBEX P1 Docs P2 Docs Learn Events
Configure stamp to handle 2 serial connections? — Parallax Forums

Configure stamp to handle 2 serial connections?

den372den372 Posts: 3
edited 2010-01-24 18:19 in BASIC Stamp
Hi, I am building a small board that will serve as a middle man between a alarm controller and a PC. When the alarm is activated it will send serial data to the middle board which will perform tasks and then pass the serial message on to the PC. The communication must be bi-directional. If the PC sends a serial message to the middle board, it receives it performs some task and then passes the serial message on to the alarm board. Luckily there will never be a time when both the alarm controller or PC need to communicate simultaneously. So, the middle board stamp must be wired to ser comm with the alarm and also to ser comm with the PC. Has anyone ever tried this? I was planning on setting p0 for ser comm with the alarm and p1 with the pc. Any questions comments appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-24 15:32
    A Stamp can send or receive serial data on any I/O pin, but only one operation at a time. The receive operation is not buffered, so the Stamp has to be executing a SERIN statement for it to "see" the data, otherwise it gets ignored. The problem with your proposal is that the Stamp can only listen to one I/O pin at a time. If there's some handshaking supported at the PC and alarm board, this could work out. In particular, if the alarm and PC only send if their CTS (clear to send) handshake line is true, the Stamp can provide that when a SERIN is executed (read the chapter on SERIN in the BASIC Stamp Syntax and Reference Manual).
  • den372den372 Posts: 3
    edited 2010-01-24 18:19
    Thanks Mike I appreciate it.
Sign In or Register to comment.