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 / //use this code and connect

//use this code and connect

|

Microcontroller › 8051 › plz tell the problem in this lcd program.it is not showing the output › //use this code and connect

June 20, 2013 at 8:03 am #9998
manohar
Participant
//use this code and connect the pins correctly data port is P1 here control pins P2.0 P2.1,P.2
 
#include<reg51.h>
#define rs  P2^0     ///edited
#define rw  P2^1   //edited
#define e  P2^2     //edited
 
void delay_ms(unsigned int m)
{
int i,j;
for(i=0;i<m;i++);
for(j=0;j<233;j++);
}
 
void lcd_command(unsigned char value)
{
P1=value;
rs=0;
rw=0;
e=1;
delay_ms(100);
e=0;
}
void lcd_data(unsigned char value)
{
P1=value;///edited
rs=1;
rw=0;
e=1;
delay_ms(100);
e=0;
}
void init()
{
lcd_command(0x38);
lcd_command(0x0e);
lcd_command(0x06);
}
void main()
{
init();
lcd_command(0x80);
lcd_data(‘s’);
delay_ms(10);
lcd_data(‘i’);
delay_ms(10);
lcd_data(‘r’);
delay_ms(10);
}

RSS Recent Posts

  • Chinese Tarrifs – 104%!?! May 21, 2025
  • An Update On Tarrifs May 21, 2025
  • Tariff Updates from JLCPCB as of Today May 21, 2025
  • Solar lighting motion detector May 21, 2025
  • Telegram Based Alarm - Sensor cable protection May 20, 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