SAMO6
Newbie level 5
Hello Everyone,
I am trying to interface 16x4 LCD with PIC18F4550.The simulation in proteus is working fine.But,I am not able to display any characters on LCD (Hardware).
I am getting only Black boxes on LCD screen, and one more thing only two lines are showing black boxes.Other two lines are showing nothing.Please find the attached images, So that you will understand my problem well.
I am using 16x4 LCD JHD539M8. I searched a lot for datasheet of this LCD.If you have datasheet of this LCD, then please send it to me.
I am using:
PIC18F4550,20Mhz Crystal Oscillator, LCD is interfaced using 8 bit mode.
I tried a lot. I also tried pull up resistors of 10K.But, still nothing is working.
Please help.
I have attached my code,proteus simulation model picture, hardware pictures with this post.
Thank you.
I am trying to interface 16x4 LCD with PIC18F4550.The simulation in proteus is working fine.But,I am not able to display any characters on LCD (Hardware).
I am getting only Black boxes on LCD screen, and one more thing only two lines are showing black boxes.Other two lines are showing nothing.Please find the attached images, So that you will understand my problem well.
I am using 16x4 LCD JHD539M8. I searched a lot for datasheet of this LCD.If you have datasheet of this LCD, then please send it to me.
I am using:
PIC18F4550,20Mhz Crystal Oscillator, LCD is interfaced using 8 bit mode.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 #include<P18F4550.h> #define RS PORTCbits.RC0 #define En PORTCbits.RC1 // LCD functions void delay(unsigned int itime) { unsigned int i,j; for(i=0;i<itime;i++) for(j=0;j<165;j++); } // LCD Functions void lcdcmd(unsigned char value) { PORTB=value; RS=0; //Select command register // delay(); En=1; // High to Low pulse on Enable pin of LCD delay(250); En=0; } void lcddata(unsigned char value) { PORTB=value; RS=1;//Select data register // delay(); En=1; // High to Low pulse on Enable pin of LCD delay(250); En=0; } void lcdinit() { lcdcmd(0x38); //Call Command subroutine (value=0x38) delay(250); lcdcmd(0x0E); delay(250); lcdcmd(0x01); //delay(); // lcdcmd(0x06); // delay(); } void stringlcd(const char * s) { while(*s) lcddata(*s++); } void main() { TRISB = 0x00; //Configure Data bus TRISCbits.TRISC0 = 0; // Configure RC0 as RS TRISCbits.TRISC1 = 0; // Configure RC1 as EN lcdinit(); delay(250); lcdcmd(0x80); delay(250); stringlcd("Hello World"); delay(250); lcdcmd(0xC0); delay(250); stringlcd("Good Morning"); lcdcmd(0x90); stringlcd("SAMO"); lcdcmd(0xD0); stringlcd("Systems"); }
I tried a lot. I also tried pull up resistors of 10K.But, still nothing is working.
Please help.
I have attached my code,proteus simulation model picture, hardware pictures with this post.
Thank you.
Last edited by a moderator: