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 / query

query

|

Microcontroller › AVR › query

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 1 month ago by Ashutosh Bhatt.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 29, 2014 at 10:49 am #3100
    ABHINAV KUMAR
    Participant
    #include<avr/io.h>
    #include<util/delay.h>
    void cmd(unsigned char y)
         {
            PORTB&=0x0F;
            PORTB|=(y&0XF0);
            PORTB|=0X08;
            _delay_ms(20);
           PORTB&=0XF3;
            _delay_ms(20);
        
           PORTB&=0X0F;
          PORTB|=((y<<4)&0XF0);
          PORTB|=0X08;
          _delay_ms(20);
         PORTB&=0XF3;
        _delay_ms(20);
      }
     
    void dat(unsigned char y)
    {
        PORTB&=0X0F;
        PORTB|=(y&0XF0);
        PORTB|=0X0C;
        _delay_ms(20);
        PORTB&=0XF7;
        _delay_ms(20);
     
       PORTB&=0X0F;
       PORTB|=((y<<4)&0XF0);
       PORTB|=0X0C;
       _delay_ms(20);
       PORTB&=0XF7;
       _delay_ms(20);
        }
     
    void display(unsigned char z[])
    {
    char i=0;
    while(z!=’’)
    {
    dat(z);
    i++;
    }}
    void main()
    {
    DDRB=0XFF;
    cmd(0x01);
    cmd(0x02);
    cmd(0x28);
    cmd(0x06);
    cmd(0x0c);
    cmd(0x80);
    display(“india”);
    }
      
     
    plz explain the above programm. its a 4-bit lcd program.
    May 29, 2014 at 6:26 pm #11781
    Ashutosh Bhatt
    Participant

    you have to read LCD operation first. read LCD interfacing tutorial. try to understand it. you yourself know what the program is doing 

  • 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

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