PDA

View Full Version : Help me in reading DATA from RFID 125KHZ tag reader



zeus
- 11th March 2008, 14:29
Dear Members,

I have a Philips P89C51RD2BN Microcontroller and a 125KHz RFID Reader from Sparr Electronics.The RFID reader just reads a tag and sent the TAG ID following a carriage-return/Line-Feed
EX:'041201938C'(CR)(LF)
I wrote a code so that the microcontroller reads the data from RFID reader via UART and checks the 7 byte of the data. But while debugging in the Keil compiler I can change the data for Sbuf. But the value is not assigned to any other variable or register.In this case to 'rfid' variable. Please help me in this problem.I have attached the code for your reference.
My baud rate is 9600 and my mcu clock is 11.0592Mhz.


#include(reg51.h)
unsigned char rfid;
void main(void)
{
unsigned char i;
TMOD=0X20;
TH1=0XFA;
SCON=0X50;
TR1=1;
while(1)
{
while(RI==0);
for(i=0;i<6;i++)
{
rfid=SBUF;
}
if(rfid==0x0b)
{
P2^=0xFF;
}
else if(rfid==0x08)
{
P0^=0xFF;
}
else
{
P2=0x04;
}
RI=0;
}
}

Acetronics2
- 11th March 2008, 14:57
Hi

1) You are aboard a MICROCHIP Pic Basic Forum

2) You are aboard a Microchip PIC Basic Forum

3) You are aboard a Microchip Pic BASIC Forum


Bye-Bye ...

Alain

skimask
- 11th March 2008, 15:38
1) You are aboard a MICROCHIP Pic Basic Forum
2) You are aboard a Microchip PIC Basic Forum
3) You are aboard a Microchip Pic BASIC Forum
I don't understand.
What do you mean by aboard?

WOW! And not only that...But which PBP update supports 8051 MCU types?

Jerson
- 12th March 2008, 05:33
You should move on over to http://www.8052.com for this