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 / Replies / Hello, every one few new

Hello, every one few new

|

Microcontroller › 8051 › INTERFACING LCD TO 8051 BY Qurat-ul-ain › Hello, every one few new

July 15, 2014 at 4:14 am #11905
Jaymin D
Participant

Hello,

 

every one

 

few new thing about h/w and s/w

 

just try it it may be useful to all who have LCD problem

 

1. if u connect LCD with PORT 0 then connect 10K pull-up resistors with M/C

 

2. connect pin no. 5,1,16 of LCD to GND

 

3. connect pin n0. 2,15 to +ve 5 V

 

4. connect excet 10K variable resistor / pot / trimmer as middle pin with pin no. 3 of LCD

 

below is the sample code for display ” 16×2 character LCD ” on LCD screen

 

LCD is connect with PORT 2 and RS at pin 1 and EN at pin 2 of PORT 1 and RW is GND in my below code..

 

just assume this code and you also edit it as per your requriment..

 

#inclde<REG51.h>

#include<stdio.h>

 

#defoine lcd P2

 

sbit rs = P1^0;

sbit en = P1^1;

 

void cmd(unsigned char value)

{

lcd=value;

rs=0;

en=0;

en=1

}

 

void data(unsigned char value)

{

lcd=value;

rs=1;

en=0;

en=1

}

 

void main()

{

unsigned char a[]=”16×2 character LCD”;

unsigned int i;

 

cmd(0x38);

cmd(0x01);

cmd(0x06);

cmd(0x0E);

cmd(0x80);

 

for(i=0;a!=’’;i++)

{

data=a;

}

 

}

 

Thats all.

 

Hope you find this helpful

 

If any doubt then conatc me for support and buying any electronics components.

 

just google : DABHI ELETCRONICS

 

and email : project[dot]student123[at]gmail[dot]com

 

Best luck

 

Regards

 

Jaymin D

RSS Recent Posts

  • going out on a limb and praying the schematic is correct May 24, 2025
  • Easy PC Demo version Schem and Layout program questions May 24, 2025
  • Actin group needed for effective PCB software tutorials May 24, 2025
  • Back to the old BASIC days May 24, 2025
  • Fluke 123 scopemeter not reading ANY voltage, please help May 24, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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