Shop OBEX P1 Docs P2 Docs Learn Events
Working with the Parallax RFID read/write module — Parallax Forums

Working with the Parallax RFID read/write module

4x5n4x5n Posts: 745
edited 2012-12-25 19:37 in Accessories
I bought a RFID read/write module a while ago and managed to forget to buy any cards to use with it. Now I got some cards and am trying to make sense out of how to work with it. I've read the documentation for it online and have tried to make sense out of the programs for using them in the docs, the forum and obex.

What's got me stuck is my understanding of how the reads and writes work. For example if I send a command to read the card will it cause to "activate" the module and then wait for a card to brought near to read or does it try to read and then return a status code right away?

I think I need to spend a lot of time playing with it and put it through it's paces. :-)

Comments

  • FranklinFranklin Posts: 4,747
    edited 2012-12-23 15:36
    Could you tell us what board you are using to read with and what program you are running? It woulsd help.
    According to the manual.
    The RFID Read/Write Module is controlled by the host via a serial communications interface. The unit
    waits in an idle state until it receives a valid header and command from the host, at which time the
    module will perform the command and return a status/error byte indicating a success or failure and
    command-specific data (if any). The module will then re-enter the idle state and wait for the next valid
    header and command.
  • 4x5n4x5n Posts: 745
    edited 2012-12-23 16:24
    I haven't actually hooked it up to anything yet (just got the cards on Saturday). Right now I'm trying to make sense out of the docs. To me it seems a bit vague about what happens if a command to read a card is sent and there isn't a card within range. Does it try and fail with some error code or does it wait for a card.

    Although my ultimate goal is to use it with a custom (to be tried later) PC with an SX28. I do have PPDB, a basic stamp and free time coming up with a couple of days off for Christmas. I'll try the code for the basic stamp with debug code added to let me know what's going on with the read loop. If there's interest I'll post the results here. Was hoping that others here with experience with the RFID module would be able to help.
  • Mike GMike G Posts: 2,702
    edited 2012-12-23 16:43
    IIRC, issue the read command. The read can be successful or an error like a timeout. On error, resend the read request (repeat), otherwise process the successful read.

    See the demo source code.
    http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/rfid/List/0/SortField/4/ProductID/688/Default.aspx
  • 4x5n4x5n Posts: 745
    edited 2012-12-23 18:55
    The Sunday night football game was boring so I dug out my PPDB and wired up my RFID R/W module.

    I was feeling to lazy to enter the entire program included with the PDF for the module. As it turns out the module doesn't wait at all and if a card isn't nearby to read it returns the return code of 0x02 (ERR_LIW).
  • kwinnkwinn Posts: 8,697
    edited 2012-12-25 19:37
    Yep, looks like you need to poll it continuously.
Sign In or Register to comment.