communication between microcontroller and rfid reader

Discussion in 'Embedded Systems and Microcontrollers' started by eeeelectx, Dec 29, 2010.

  1. eeeelectx

    Thread Starter New Member

    Dec 29, 2010
    3
    0
    I have rfid reader which gives the data in 9600 baud rate and 8 data bit with 1 stop bit (through one pin means serial). I also got the 2 card which transmit the 14 bit hex data of them. i have connected my circuit using at89s52. When the card is taken near the rfid reader i have to read this value.
    How can i write the program so i can compare the data given by this rfid reader with my already got data????
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Have you worked with the UART on the microcontroller? It is a matter of hooking up the Tx and Rx lines, power and ground, then setting the baud rate of the UART port in code to receive.
     
  3. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    You might need to invert the levels with a ST232 chip or similar.
    I'd also recommend using a PC and Realterm or similar so you can see exactly what is being transmitted. USB to serial converters are cheap if your PC doesen't have a serial port.
     
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    That is for the RFID reader connecting to the PC.

    I guess I'm not clear if he is connecting the RFID/8051 to the PC, or if he is working on communication between that and a PC. For logic level UART, the uC has one on board that can be set up for baud rate, stop bits, parity, etc. For RS-232 serial output to a PC, you would need a level converter such as the ST232 mentioned, or a MAX232.
     
  5. eeeelectx

    Thread Starter New Member

    Dec 29, 2010
    3
    0
    actually i have to transmit the data from rfid reader to microcontroller and then i have to transmit it to pc. In pc i compare the data and transmit back if the comparision is equal or not. In pc i use data base to store the data of card.
    Now i need code for this circumstances for at89s51
     
  6. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    So your processor actually needs 2 UARTs, one for the RFID unit and one for the computer? It's possible to create a UART in software, but it's not a beginner project. I don't know your processor, but if it has only 1 UART, you might want to look for a dual-UART unit.
     
Loading...