Fob RFID tag reading problem
![Luis_P](https://forums.parallax.com/uploads/userpics/943MO9HECKJ3/nO7HZN7DAZ7N6.jpeg)
I'm new to RFID. I'm trying to simple read the "Blue Eye Key Fob Tag" with the "Read/Write Module, Serial Item code 28440". I thought was going to be a simple task. well not! I want just read any tag close to the module. I used the code provided for BS2 but nothing happens. I need help do not know what's wrong. connections are very simple (GND, 5V and TX, RX) I need a simple testing code to start that do not include writing, only read the blue tags.
(SOLVED!)The code below is working now:
'
[ Program Code ]
#SELECT $STAMP
#CASE BS2, BS2E, BS2PE
T9600 CON 84
#CASE BS2SX, BS2P
T9600 CON 240
#ENDSELECT
RFID_TX PIN 0 ' Connects to RFID R/W Module SIN
RFID_RX PIN 1 ' Connects to RFID R/W Module SOUT
Baud CON T9600
RFID_ReadLegacy CON $0F ' Read unique ID from EM4102 read-only tag (for backwards compatibility with Parallax RFID Card Reader, #28140 and #28340) (12)
buf VAR Byte(12) ' data buffer
idx VAR Byte ' index
Initialize:
PAUSE 250 ' let DEBUG open
DEBUG CLS ' clear the screen
Main:
DEBUG "Reading ID tag unique serial number..." ' Read unique ID from EM4102 read-only tag
Read_Legacy:
SEROUT RFID_TX, Baud, ["!RW", RFID_ReadLegacy]
SERIN RFID_RX, Baud, [STR buf\12] ' Get header and data
IF buf(0) <> $0A THEN Read_Legacy ' If we don't receive the correct header, keep trying until we do
FOR idx = 1 TO 10 ' Display the data (ignore final \r byte sent by the reader)
DEBUG buf(idx)
NEXT
DEBUG CR
PAUSE 2000
GOTO Main ' Do it all over again!
END
(SOLVED!)The code below is working now:
'
[ Program Code ]
#SELECT $STAMP
#CASE BS2, BS2E, BS2PE
T9600 CON 84
#CASE BS2SX, BS2P
T9600 CON 240
#ENDSELECT
RFID_TX PIN 0 ' Connects to RFID R/W Module SIN
RFID_RX PIN 1 ' Connects to RFID R/W Module SOUT
Baud CON T9600
RFID_ReadLegacy CON $0F ' Read unique ID from EM4102 read-only tag (for backwards compatibility with Parallax RFID Card Reader, #28140 and #28340) (12)
buf VAR Byte(12) ' data buffer
idx VAR Byte ' index
Initialize:
PAUSE 250 ' let DEBUG open
DEBUG CLS ' clear the screen
Main:
DEBUG "Reading ID tag unique serial number..." ' Read unique ID from EM4102 read-only tag
Read_Legacy:
SEROUT RFID_TX, Baud, ["!RW", RFID_ReadLegacy]
SERIN RFID_RX, Baud, [STR buf\12] ' Get header and data
IF buf(0) <> $0A THEN Read_Legacy ' If we don't receive the correct header, keep trying until we do
FOR idx = 1 TO 10 ' Display the data (ignore final \r byte sent by the reader)
DEBUG buf(idx)
NEXT
DEBUG CR
PAUSE 2000
GOTO Main ' Do it all over again!
END
Comments
Thanks. the module reader is connected VCC to the Vdd (5V stamp), GND to Vss( - stamp) then SIN to PIN0, SOUT to PIN1.
I get DEBUG "Reading...." but nothing else happens.