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 / LCD BASIC

LCD BASIC

|

Microcontroller › 8051 › LCD BASIC

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 8 months ago by Ashutosh Bhatt.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 22, 2015 at 6:03 pm #3924
    Shiv Kumar Mishra
    Participant

    I have a doubt in LCD code. i know, its silly question for u people but it makes big difference for me. Please 1st go through the code and at the end my questions are: 

     

    void lcdcmd(unsigned char item)  //Function to send command to LCD

    {

    dataport = item;

    rs= 0;

    rw=0;

    e=1;

    delay(1);

    e=0;

    }

     

    void lcddata(unsigned char item)  //Function to send data to LCD

    {

    dataport = item;

    rs= 1;

    rw=0;

    e=1;

    delay(1);

    e=0;

    }

     

    void main()

    {

    lcdcmd(0x38); 

    lcddata('A');

    }

     

    1. Inside the main() when we call function " lcdcmd(0x38); , the control goes on function defintion.

    the function is:

    void lcdcmd(unsigned char item) ;

    how char datatype accept hex value i.e. 0x38 as a argument and now the arguments pass to the dataport

    dataport=item; // what does this line means. It is necessary to give the command to the data port. 

     

    Thanks in Advance !!!

     

    August 22, 2015 at 7:55 pm #13203
    Ashutosh Bhatt
    Participant

    dataport is a symbole created using #define

    it does not mean it will accept only data. its a hardware port of 8051

    in embedded C for 8051 the data must of 8 bit

    and unsigned char is only 8 bit data. that's why we are using unsigned char

  • 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

  • AI algorithm for bots April 17, 2026
  • SDCC Array Access In Timer 0 Interrupt Handler April 16, 2026
  • EasyEda program has a major bug April 16, 2026
  • ANOTHER OLD PROJECT REDO April 16, 2026
  • How to set the OSCAL in a PIC 12F675 April 16, 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