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.

RFID problem with pic16f

Status
Not open for further replies.

rfidproblem

Newbie level 3
Joined
Feb 12, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,307
Hello guys ,,
I have a problem with my project, its a rfid reader (125 KHz) connected to pic16f877a with a LCD (works fine without rfid )..

after I connect them ,, I only see the cursor down , but nothing happens when I try to make it read the tags!


my code (micro c):
Code:
unsigned char uart_rd;
unsigned char data;
unsigned char temp[13];
unsigned char N = 0;

void main() {
   TRISD = 0x80;

   TRISB = 0;
   PORTB = 0xFF;
   USART_Init(9600);
   Delay_ms(100);

   Lcd_Init(&PORTB);
   Lcd_Cmd(LCD_BLINK_CURSOR_ON);
   Delay_ms(1000);

   do {
   if (USART_Data_Ready()){              //<------ Check if a character has been received before reading
       uart_rd = USART_Read();     // read the received data,
       USART_Write(uart_rd);

       temp[N] = uart_rd;

       N = N +1;

       if (N == 12) // temp storing  string
       {
          temp[12] = 0;
          Lcd_Cmd(LCD_CLEAR);
          Lcd_out(1,1,temp);
          N=0;
        }

       }
    } while(1);
}


he datasheets for the rfid and LCD:

**broken link removed** ... _uart.html

**broken link removed**

the circuit of my project is in the attachment

can anyone help me plz??
circuit2.jpgcircuit2.jpg
 

I have a problem with my project, its a rfid reader (125 KHz) connected to pic16f877a with a LCD (works fine without rfid )..

after I connect them ,, I only see the cursor down , but nothing happens when I try to make it read the tags!

First of all, are you sure the RFID reader is the version with TTL Serial Interface? And not the Wiegand Interface?

The two interfaces are not compatible.

The LCD works fine without the RFID attached? In other words, you can easily display various character strings on either line?

BigDog
 

First of all, are you sure the RFID reader is the version with TTL Serial Interface? And not the Wiegand Interface?

The two interfaces are not compatible.

The LCD works fine without the RFID attached? In other words, you can easily display various character strings on either line?

BigDog

I bought the rfid from this website:
125Khz RFID module - UART [RFR101A1M] - $12.50 : Seeed Studio Bazaar, Boost ideas, extend the reach

and according to it ,, it has a TTL Serial Interface

The LCD works fine without the RFID and I can display any charachter on both lines.
 

.....and according to it, it has a TTL Serial Interface

Do you have any test equipment, oscilloscope, logic analyzer, etc?

Have you tried connecting the RFID reader directly to your PC using a RS-232 transceiver, like a MAX232?

You need to establish, the device does indeed have a TTL Serial Interface and not a Wiegand Interface.

BigDog
 

I've changed the code and I got this string:

https://www11.0zz0.com/2012/02/26/09/280708830.jpg
https://www11.0zz0.com/2012/02/26/09/464098718.jpg
https://www11.0zz0.com/2012/02/26/09/682491035.jpg

and the code :
unsigned *text1 = "RFID Test #1";
unsigned *text2 = "Show Your Card";
unsigned *text3 = "Waiting";
unsigned *text4 = "Card Data >>";
unsigned short i;
char temp[15];
void main(){

delay_ms(50);

Lcd_Init(&PORTB);

USART_Init(9600);

Lcd_Cmd(LCD_CLEAR);
Lcd_Cmd(LCD_CURSOR_OFF);
LCD_Out(1,1,text1);
delay_ms(50);

while(1)
{

LCD_Out(1,1,text2);
LCD_Out(2,1,text3);


if (UsART_Data_Ready()){
if (usart_read()== 2)
{
Lcd_Cmd(LCD_CLEAR);
LCD_Out(1,1,text4);


//Dump Remaining 11 bytes

for(i=0;i<11;i++)
{
temp = usart_read();
LCD_Out(2,1,temp);
}
usart_read();

delay_ms(2000);
//Now Clear it
Lcd_Cmd(LCD_CLEAR);
}
}
}
}


I think the problem is in the code !!
Can u help me with it?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top