Shop OBEX P1 Docs P2 Docs Learn Events
BS2, SERIN, RFID question — Parallax Forums

BS2, SERIN, RFID question

DarylMDarylM Posts: 3
edited 2009-06-25 19:59 in BASIC Stamp
I have the following line of code,

SERIN RXRFID, T2400, 1000, continue_loop, [noparse][[/noparse]WAIT($0A), STR Buffer\10]

I have a circuit feeding the serial RFID from Parallax and "on occasion" the BS2 stamp appears to halt at this location.

If I disconnect the RFID, it will immediatly timeout and resume at continue_loop above.· (plug the RFID in and all works fine)

I have ran debug code on each side of the serin command above and it seems to be stuck on the SERIN command.

this has happend to me twice - with over 500 runs of the code.

so, my specific questions is, under what circumstances will the BS2 not timeout on the SERIN command?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-06-25 17:00
    Anytime the signal line toggles at all the timeout counter is reset. So if there is noise or false data on the SERIN pin it may never timeout. You could also try a lower timeout value. But it seems you may have some noise there or false readings.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • DarylMDarylM Posts: 3
    edited 2009-06-25 18:36
    Great & quick response Chris thanks! Makes perfect sense....

    any idea how I could trap for this in code? I have played with the timeout value a little but I'm open to ideas. Basically just a standard connected RFID circuit, reading a card that is in a holder (ie. a stationary position) as opposed to being swiped.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-06-25 19:20
    I would be interested in knowing the source of the noise. If you don't have a scope or Logic Analyzer you may have to reduce the timeout value until it works. Without knowing why/how the line is noisy it's hard to suggest anything else.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • DarylMDarylM Posts: 3
    edited 2009-06-25 19:59
    I will scope it and see what I can find. I too am curious as to the noise source. It is a relatively harsh environment and there is a couple of other hardware design considerations. I will try and adjust the timout value and scope things out.

    thanks for the help!
Sign In or Register to comment.