EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / RFID tag ID display problem *need help*

RFID tag ID display problem *need help*

|

Microcontroller › 8051 › RFID tag ID display problem *need help*

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 3 months ago by AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 21, 2014 at 5:04 am #3319
    Jasper Nunisa
    Participant

    Hey guys, Ive been working on displaying the RFID tag ID on a LCD using 8051 microcontroller. I used the simple-to-use RFID module from Positron Technologies and interfaced it to 8051 using Max232. But everytime I scan the tag, it shows some weird characters instead of numbers with checksum value. I connected the module separately by RS232 to the pc using hyperterminal and the tag works just fine but on the LCD it just shows some garbage. Can anybody help me out, please??

     

    Here’s the program

    //Program to interface RFID with 8051 microcontroller (AT89C51) 
    #include<reg51.h>
    unsigned int data_out,command=0x80,temp;
    sfr lcd_data_pin=0x90; //port 1 
    sbit rs=P0^0;        //Register select 
    sbit rw=P0^1;        //Read/Write 
    sbit en=P0^2;        //Enable pin
    unsigned char card_id[12];
     
    void delay(unsigned int count)    //Function to provide delay
    {
        int i,j;
         for(i=0;i<count;i++)
         for(j=0;j<1275;j++);
    }
     
    void lcd_command(unsigned char comm)   //Lcd command funtion
    {
         lcd_data_pin=comm;
         en=1;
         rs=0;
         rw=0;
         delay(1);
         en=0;
    }
     
    void lcd_data(unsigned char disp)  //Lcd data function
    {
         lcd_data_pin=disp;
         en=1;
         rs=1;
         rw=0;
         delay(1);
         en=0;
    }
     
    lcd_string(unsigned char *disp)     //Function to send string 
    {
         int x;
         for(x=0;disp[x]!=’’;x++)
        {
             lcd_data(disp[x]);
        }
    }
    void lcd_ini()                  //Function to initialize the LCD
    {
        lcd_command(0x38);          
        delay(5);
        lcd_command(0x0F);        
        delay(5);
        lcd_command(0x80);
        delay(5);
    } 
     
    void recieve()     //Function to recieve data serialy from RS232 
    {
        unsigned char k;
         for(k=0;k<12;k++)
         { 
             while(RI==0); 
              card_id[k]=SBUF;
              RI=0;
        }
    }
     
    void main()
    {
        int l;
        TMOD=0x20;            //Enable Timer 1
        TH1=0XFD;
        SCON=0x50;
        TR1=1;                // Triggering Timer 1
        lcd_ini();
        lcd_command(0x81);        //Place cursor to second position of first line 
        lcd_string(“UNIQUE CARD ID:”);
        delay(200);
        while(1)
        {
             recieve();
             lcd_command(0xC1);        //Place cursor to second position of second line
             for(l=0;l<12;l++)
             { 
                  lcd_data(card_id[l]);
              }
          }
    }
     
    November 26, 2014 at 6:56 am #12370
    AJISH ALFRED
    Participant

    Hi Jasper,

     

    Try increasing the delay in your code, 

     

    void lcd_command(unsigned char comm)   //Lcd command funtion
    {
         lcd_data_pin=comm;
         en=1;
         rs=0;
         rw=0;
         delay(1);
         en=0;
    }
     
    put one more delay after en = 0;
  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • What diode should I use? March 7, 2026
  • LM016L + PCF8574 I2C Backpack Schematic with Backlight Control March 7, 2026
  • Expensive hobby March 7, 2026
  • USING EASYEDA BUT SOMETHING ISN'T RIGHT? March 7, 2026
  • What is this component and what is its function? March 6, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise