RFID and Javelin Stamp
I have the Parallax RFID reader and the Javelin Stamp board, and I was just looking for a simple tutorial or description of how to get the two communicating. I've not done any serial communication or anything like that, so I'm kinda' in the dark here. Any help would be fantastic. [noparse]:)[/noparse]
Comments
http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/RFID-Reader-v1.2.pdf
communication is TTL level serial 2400baud non-inverted.
So you need to connect the module's SOUT pin to a Javelin I/O pin
and declare a receive Uart on that pin.
import stamp.core.*;
public class rfid_test {
· static Uart rx = new Uart(Uart.dirReceive,CPU.pin0,Uart.dontInvert,Uart.speed2400,Uart.stop1);
· static void main() {
··· int c = 0;
··· while (true) {
····· while (c != 0x0A) c = rx.receiveByte(); //wait for arrival of 0x0A (start byte)
······for (int i=0; i<10; i++) { //receive 10 digits
······· c = rx.receiveByte(); //receive a digit
······· //do something with the digit
····· }
····· c = rx.receiveByte(); //receive 0x0D (stop byte)
··· }
· }
}
regards peter
Okay, I've been working with this code, and it never started reading. So I got to tinkering.
My output is not at all what I'm expecting. It will print about thirteen 0s, then a negative number (-1, -2 are most common, sometimes it prints -8 or -16). I've no clue what's going on inside that RFID tag. All the bits should be identical (for this tag). Any clue of what's going wrong?
Many thanks.
Post Edited (zachwlewis) : 1/24/2008 6:26:49 PM GMT
········System.out.print(""·+·rx.receiveByte()·+·"\n");
because javelin java cannot mix strings and integers as pc java can.
Try attached program, it prints received bytes as hexadecimal strings.
regards peter
I have several programmed World TAG RFID tags, and I ran a few tests on this RFID reader. Here's the output for a few trials of the tags.
Tag 1
Tag 4
Tag 7
The first thing I noticed was there were actually 15 output words instead of the 10 that were supposed to appear. Secondly, every one was 00, save the final word. Finally, the final word would vary when doing multiple trials of the same tag.
The tags and tag reader have been tested on a different platform and have returned proper results, so I don't think there is a tag or hardware problem. Am I doing something wrong software side? I really appreciate your help so far.
Post Edited (zachwlewis) : 1/25/2008 9:34:46 PM GMT
When you say ‘programmed tags’, what do you mean? The tags we carry are not programmable. Each has a unique value assigned to it. Are these the tags you’re using?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
As I've mentioned before, we've tested the reader and tags with a separate platform (some BASIC microcontroller), and they have worked properly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
how it did work and adjust·the javelin program accordingly.
regards peter