RFID reading problem
Laross
Posts: 1
Greetings guys,
I'm having this problem on my BASIC Stamp program where, when I scan a tag across the reader, it displays the correct ascii code, but tells me that it's a bad tag. Also, I'm using the BASIC Stamp 1 code from the RFID Tag reader documentation. Can anyone help?
I'm having this problem on my BASIC Stamp program where, when I scan a tag across the reader, it displays the correct ascii code, but tells me that it's a bad tag. Also, I'm using the BASIC Stamp 1 code from the RFID Tag reader documentation. Can anyone help?
Comments
I'm working with the orginator of this thread for his senior project. To be specific, when we use this code with his BS1:
We then get a printout like this:
My understanding is that these are decimal values, and that if we want to read them in they should be in ASCII characters - like the Parallax example code below:
But here's our problem; When we convert our decimal values to ASCII character codes, we get something in the extended ASCII range, like this:
We've read the RFID reader PDF guide (v2.2), and haven't been able to succesfully get a tag we read in to match a tag in that we've stored in EEPROM. My guess is that we're either not printing deicmal values when using DEBUG, or that our conversion is off - way off.
Please help.
Lamar
Note that, if you prefer using hexadecimal for your debug display, you can use "$" instead of "#".
So we get the header byte 0x0A (byte 0 of 12). Next we get the first byte of the RFID tag (byte 1 of 12), which prints out as 146. As you've suggested, this is out of normal decimal range for ASCII characters ( > than 127 ). We've used $ to display in Hex. Still the same result.
I'm starting to think that perhaps this line is bad:
Tonight we'll try to save the first byte of the serial transmission to a variable, instead of ($0A). Perhaps, we aren't fully reading the first byte and are geting an offset that throws off all the values we get...? I'm thinking in binary. Like 00001010 is the first byte, and maybe we are reading only the first four bits 0000. Then we read 1010 (the seconds 4 bits) and then the next 4 bits of the first real byte of RFID tag identification.
The only reason I'm skeptical about this theory is because we're using the sample code from Parallax... which, if incorrect, would have a lot of forum posts about this. I've dug a lot, and haven't found someone with this exact problem. Hopefully it's somthing simple.
Thanks again for your help. Any further suggestions would be greatly appreciated.
Lamar
We'll provide specific information on how we have the RFID reader connected to the BS1 this afternoon. Although, if it is garbage we are reading in, it's very consistent. We can swipe the same tag 5 or 6 times and always get the same result.
The same goes for other tags we have tried. Each tag is unique, and after each swipe the unique code is always displayed.
<http://electronics.stackexchange.com/questions/49318/why-most-does-rfid-tags-use-hexadecimal-number> provides a good source for understanding why HEX a little better.
Given this info... I would do one of two things: 1) Continue to use the unique 10 x DEC value, storing the string in EEPROM as a valid tag, or 2) Convert the DEC values to HEX and store those values for later use. Either way I think you still have a unique identification number for each of your tags.