Microcontroller › 8051 › black boxes on 16×2 LCD
- This topic has 13 replies, 9 voices, and was last updated 10 years, 10 months ago by Ganesh Selvaraj.
-
AuthorPosts
-
November 1, 2011 at 7:01 am #1368sachinParticipant
i am begineer in microcontroler and making project at89c51 based “A” character display. i make it and after on supply lcd shows black boxes on first row.i am not able to rectify it.what is generally cause of this ? how to solve it? plz tell me step by step…………………………..
November 1, 2011 at 8:40 am #6772QaisarParticipantblack boxes means data is not transfering to lcd ..
visit post ”lcd interfacing to 8051 by qurat ain” i put code and diagram there.
first try that code and diagram . if still u r unable to interface lcd then check ur haedware and lcd connection.
November 1, 2011 at 8:40 am #6773QaisarParticipantblack boxes means data is not transfering to lcd ..
visit post ”lcd interfacing to 8051 by qurat ain” i put code and diagram there.
first try that code and diagram . if still u r unable to interface lcd then check ur haedware and lcd connection.
November 10, 2012 at 9:00 pm #8733SajjadParticipanti have the same problem….. i get the results on simulations but i get black boxes on harware…. kindly help me out… i am using thi engineers garage code…..
November 11, 2012 at 5:48 am #8734AJISH ALFREDParticipantBlack boxes on the first row means “LCD not initialized”. Only after proper initialization an LCD can display characters.
Problem could be either hardware or software. First check your circuit connections and then your code.
If possible post your connection diagram here.
November 11, 2012 at 11:44 am #8737SajjadParticipantwysiwyg_imageupload:6726:THIS IS THE CUIRCUIT DAIGRAM I AM USING. i get black boxes in ist row. kindly tell me if there is any flaw?
November 11, 2012 at 11:49 am #8738SajjadParticipant//Program to Display string on LCD using AVR Microcontroller (ATmega16)
/*LCD DATA port—-PORT Bsignal port
PORT Drs
PD0rw
PD1en
PD2*/#include<avr/io.h>#include<util/delay.h>#define LCD_DATA PORTB //LCD data port#define ctrl PORTD#define en PD2 // enable signal#define rw PD1 // read/write signal#define rs PD0 // register select signalvoid LCD_cmd(unsigned char cmd);void init_LCD(void);void LCD_write(unsigned char data);int main(){DDRB=0xff;DDRD=0x07;init_LCD(); // initialization of LCD_delay_ms(50); // delay of 50 mili secondsLCD_write_string(“EngineersGarage”); // function to print string on LCDreturn 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);_delay_ms(1);ctrl =(0<<rs)|(0<<rw)|(0<<en);_delay_ms(50);return;}void LCD_write(unsigned char data){LCD_DATA= data;ctrl = (1<<rs)|(0<<rw)|(1<<en);_delay_ms(1);ctrl = (1<<rs)|(0<<rw)|(0<<en);_delay_ms(50);return ;}void LCD_write_string(unsigned char *str) //store address value of the string in pointer *str{int i=0;while(str!=’