0
\$\begingroup\$

I just received an RFID reader from Parallax (#28440) to play with, and am having some problems getting it to send me data. I'm interfacing it with the mbed microcontroller that I also just received.

The RFID reader interfaces via RS232 (5V level), so that matches my mbed serial port perfectly. I have written test code on the mbed side so I know my RS232 code works. However, whenever I send commands to the reader (e.g. "!RW\x0F"), I get result codes that aren't even in the documentation. Specifically, most of the time I get back 0xE1 or 0xF8, when the actual result codes should be something like 0x01 - 0x07.

What's annoying is that their documentation doesn't give any timing tables, so I'm just guessing when I send all of the data at once and read immediately. I've tried different time delays, and nothing works.

I am powering both mbed and RFID reader from the USB port. Since USB supplies 500mA without external power, and the mbed uses 100ma and the RFID reader uses < 200mA, I figure I have plenty of headroom. Perhaps tomorrow I should hook up the lab supply.

Has anyone here used this reader with reasonable success?

\$\endgroup\$
  • 3
    \$\begingroup\$ The USB spec is not a flat 500mA, it's that the device can ASK for up to 500mA. If the mbed tells the PC that it only needs 110mA as part of the USB configuration process then it's possible the USB chipset will current limit to that. \$\endgroup\$ – darron Dec 15 '10 at 16:33
  • \$\begingroup\$ @darron good point! I forgot about that. So that totally makes sense now. thank you. \$\endgroup\$ – Dave Dec 15 '10 at 22:46
2
\$\begingroup\$

As I said in my original question, I thought about hooking up a lab supply even though, according to the specs, both devices combined fall under the 500mA USB spec. I put a voltmeter across the 5V bus, and sure enough, it was dropping well below 2.5V anytime I sent a command to the reader.

I hooked up my lab power supply, and immediately my !RW\x0F command returned 12 bytes as expected. Not the correct 12 bytes, but at least the data was being sent. It's possible that my reader just doesn't support this "legacy" command.

I then sent the login command, using the default password. Without a tag, I would receive 0x02, which is "could not find a listen window from the tag". Makes sense! I then put my tag over the reader, and unfortunately got a 0x03, which is a "received NAK" message. Oh well. I have other things to sort out, but at least I know my mbed code and RFID reader are functioning properly.

Hopefully, this basic debugging technique is helpful to someone.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Yes I have used it successfully (I used the receive-only version).

On the mbed, do you have the correct baud rate selected?

Another thing to try is hook it up to your serial port on the PC and send it commands to see if that works.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I'm positive that I have the baud rate and other parameters set properly -- 9600,8,N,1, according to the specs. And the dead giveaway is that I get ASCII back and not complete garbage. I'd wire it up to my PC, but I have to get the components for the MAX232 first. It would be helpful if you can post pseudocode for what you've done. Or if you want, I can post mine for commenting. But it really seems so dead simple. What are you doing regarding time delays, etc? \$\endgroup\$ – Dave Dec 15 '10 at 13:43
  • \$\begingroup\$ my code was very simple, wait and read serial data, then echo out on the other serial port, nothing fancy. i had no delays, why are you sending 0x0F? are you trying to read a legacy tag? Try 0x01 with a tag and see if you get anything back. \$\endgroup\$ – jsolarski Dec 15 '10 at 14:01
  • \$\begingroup\$ sry the full command to send would be "!RW"+ "0x01" +"[1-33]" the data sheet will give the specifics for the command, but i believe you should be sending everything at once, no delays \$\endgroup\$ – jsolarski Dec 15 '10 at 14:16
  • \$\begingroup\$ ok, thanks. I solved my problem, I think. I've added my answer to help others in general debugging techniques. \$\endgroup\$ – Dave Dec 15 '10 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.