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 / character is not displayed in LCD

character is not displayed in LCD

|

Microcontroller › AVR › character is not displayed in LCD

  • This topic has 1 reply, 2 voices, and was last updated 6 years, 11 months ago by Vara Ashishkumar.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 1, 2015 at 2:18 pm #3955
    prasant
    Participant

    hi everyone i m  doing project for led interface 16*2 with atmega 16 ,,   i write the code exactly which is listed in  avr series ,, but the character is not displayed in the lcd but blacklight only  on ,,, the code is below i ve copied ,, and  i m working on avr studio 4 ,, hex file is generated but when it is uploaded on mc nothing happen to the lcd ,, ????  character A is not displayed 

     

     

     
    #include<avr/io.h>
    #include<util/delay.h>
     
    #define LCD_DATA PORTA // LCD data port
    #define ctrl PORTB
    #define en PB2 // enable signal
    #define rw PB1 // read/write signal
    #define rs PB0 // register select signal
     
    void LCD_cmd(unsigned char cmd);
    void init_LCD(void);
    void LCD_write(unsigned char data);
     
    int main()
    {
    DDRA=0xff; // making LCD_DATA port as output port
    DDRB=0x07; // making signal as out put
    init_LCD(); // initialization of LCD
    _delay_ms(50); // delay of 50 milli seconds
    LCD_write('A'); // call a function to write A on LCD
    return 0;
    }
     
    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;
    }
     
    void LCD_cmd(unsigned char cmd)
    {
    LCD_DATA=cmd;
    ctrl =(0<<rs)|(0<<rw)|(1<<en); // RS and RW as LOW and EN as HIGH
    _delay_ms(1);
    ctrl =(0<<rs)|(0<<rw)|(0<<en); // RS, RW , LOW and EN as LOW
    _delay_ms(50);
    return;
    }
     
    void LCD_write(unsigned char data)
    {
    LCD_DATA= data;
    ctrl = (1<<rs)|(0<<rw)|(1<<en); // RW as LOW and RS, EN as HIGH
    _delay_ms(1);
    ctrl = (1<<rs)|(0<<rw)|(0<<en); // EN and RW as LOW and RS HIGH
    _delay_ms(50); // delay to get things executed
    return ;
    }
     
    September 2, 2015 at 12:14 pm #13254
    Vara Ashishkumar
    Participant

    Hey prasant,

    Are you sure for hardware connection? Please check connection of your circuit.

  • 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

  • Diameter of breadboard holes incompatible with size of components pins and jumper wires etc. August 16, 2022
  • Bose SoundTouch 20 - IC identification August 15, 2022
  • Digital Display Information August 15, 2022
  • 6V to 5.2V linear voltage regulator August 15, 2022
  • Nokia 5110 HW in Oshonsoft August 15, 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