Microcontroller › 8051 › 8051 PIR RFID BASED PROGRAM ERROR › this might help
September 17, 2016 at 6:08 am
#14139
GANEEV SINGH
Participant
Hi Devjeet
I dont know if this happens only wiht 8051s but yeah the number that is written on the RFID card is not what you'll see on LCD after processing.First try out reading the card value using the code written below, also its better to read 14 bytes from RFID module becuase these 14 byes include start byte, stop byte and 12 data bytes. here's the code:
for(i=0;i<15;i++) // 15 works fine here
{
j=0;
while(RI==0)
{
if(j>=1000)
goto timeout;
j++;
}
c=SBUF;
RI=0;
}
timeout:
c[12]=''; //this ensures that only 12 byte data is stored in c[]
also after this you can print this c[] over the LCD to get RFID card's comparable value. Here you go:
i=0;
while(c!='')
{
lcdData(c);
i++;
}
Now note down this value somewhere, this will help in recognizing the card in future while working out through your code.
Replace "F0200CE7E8D3" value that you have written in your code with the new one.
Hope this helps.
Good luck