Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Reading RFID tag and sending it through RS232 on PIC18F4455

Status
Not open for further replies.

wwwbeck

Newbie level 2
Joined
Mar 22, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,298
I wrote a very simple code to detect RFID tag but i was only able to obtain first 16bits of the tag, the rest just does not show at all. I'm using PIC18F4455 chip and PIC CCS Compiler. I am hoping someone can help me out with this. Here is my code:


#include <18F4455.h>
#fuses HS,NOLVP,NOWDT,PUT
#include <stdlib.h>
#include <input.c>
#use delay(clock=20000000)
#use rs232 (baud=9600, xmit=PIN_C6, rcv=PIN_C7)

void main() {
char id_string[13];
char received;
int i;

while(TRUE)
{
if(kbhit()) //If there is data in the receive buffer
{
for(i=0; i<13; i++)
{
id_string=getc();
printf("Reading data %d..\n",i);
printf("Data == %d (In D)\n", id_string);
}
}
} //While True
 

hai,
why you didn't use receive interrupt and rcreg check.store the all rfid values on array and compare in main program.
 

I figured what the problem is. I tried using receive interrupt as well, but it didn't work as I was expecting. The problem is that PIC18F4455 has a limited buffer size to about 24bits. RFID reader sends 40bits, which is more than what Rx buffer can handle at 9600 baud rate. My reader is set to 9600 baud rate and i can't change that. It is ID 12 RFID reader.
So, i am going to try usb connection instead. It should handle around 256bits. I think that will work.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top