Shop OBEX P1 Docs P2 Docs Learn Events
Serin problem — Parallax Forums

Serin problem

pusinkpusink Posts: 68
edited 2007-11-26 19:21 in BASIC Stamp
I have 2 code, 1st - PC_comm, I use this code to control BS2sx via PC and 2nd - RFID, i use this code to get ID number from RFID reader and send to PC. how to write this two code inside 1 chip....??

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2007-11-26 19:16
    Keeloq,

    There are some compromises which have to be considered.

    1. The Stamp can only deal with one task at a time, and it has no serial communication buffer. Suppose the priority job is to watch for input from the RFID. The Stamp can easily capture this data then immediately send it to the PC (which does have a comm buffer).

    2. Should the Stamp be waiting at an appropriate SERIN command when the PC sends its string, all will be well. But, the Stamp's priority is the RFID so it is likely the Stamp will miss the PC's message.

    3. It may be possible for the Stamp to have two loops, one watching the RFID and the second watching the PC. By alternating back and forth at some time period, say 0.5 seconds, the system may be able to perform both tasks. It may also be possible for either the PC or RFID to send multiple copies of the strings on each transmission so that the Stamp has more time to be at the appropriate SERIN.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-26 19:21
    Another option would be to use an external serial buffer like this one: www.proteanlogic.com/product_periph_rs232.shtml.
Sign In or Register to comment.