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
You are here: Home / Topics / urgent help for 16*2 lcd interfacing

urgent help for 16*2 lcd interfacing

|

Microcontroller › AVR › urgent help for 16*2 lcd interfacing

  • This topic has 1 reply, 2 voices, and was last updated 11 years ago by dagakshay.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • June 30, 2011 at 12:35 pm #1024
    raj ranjan
    Participant

    i am using JHD16 2A 16*2 lcd display ..

     

    i have done all the connections according to the tutorial…..

    the code is

     

    #include<avr/io.h>
    #include<util/delay.h>
     
     
    #define LCD_DATA PORTA   //LCD data port is set as PORTA of microcontroller
    #define ctrl PORTB       // PORTB is defined as ctrl
    #define RS PB0
    #define RW PB1
    #define EN PB2
     
     
     
    void LCD_cmd(unsigned char cmd);
    void init_LCD(void);
     
     
    void LCD_cmd(unsigned char cmd)
    {
     
    LCD_DATA=cmd;
    ctrl=((0<<RS)|(0<<RW)|(1<<EN));
    _delay_ms(1);
    ctrl=((0<<RS)|(0<<RW)|(0<<EN));
    _delay_ms(50);
    return;
     
    }
     
    void init_LCD(void)
     
    {
     
        LCD_cmd(0x38); // initialization of 16X2 LCD in 8bit mode
    _delay_ms(1);
     
    LCD_cmd(0x01); // clear LCD
    _delay_ms(1);
     
    LCD_cmd(0x0E); // cursor ON
    _delay_ms(1);
     
    LCD_cmd(0x80); // —8 go to first line and –0 is for 0th position
    _delay_ms(1);
    return;
     
    }
     
     
    int main(void)
     
    {
     
    DDRA=0b11111111;
    PORTA=0b00000000;
    DDRB=0b00000111;
    PORTB=0b00000000;
     
    init_LCD();
    _delay_ms(100);
     
    }
     
     
     
    please help me 
     
    July 23, 2011 at 6:26 am #6506
    dagakshay
    Participant

    let me know the problem you facing so that i can help you out

  • 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

  • Circuit Problem August 14, 2022
  • Beam Break Sensor August 14, 2022
  • Drill speed controller fault August 14, 2022
  • uc3843 Buck-boost August 14, 2022
  • Right channel distortion on vintage fisher rs-2010 August 13, 2022

Stay Up To Date

Newsletter Signup
EngineersGarage

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