darkfall94
Newbie level 6
- Joined
- Nov 8, 2014
- Messages
- 13
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 126
Hello,
My project is interfacing a keypad & LCD with microcontroller i.e i press the button on my keypad and the LCD displays the number and number of times the key is pressed.
If you see the above code,it uses a header file lcd.h
The code for the header file is:
The only change i made is connect pin 3 of lcd i.e vee to +VCC=5V due to unavailability of a potentiometer.
I simulated the circuit with the code on Proteus software and it works like a charm--perfect!
but now when i supply power to circuit, the lcd displays black boxes..
lcd is jhd162a
here's the link for its datasheet:
http://www.itron.com.cn/PDF_file/JHD162A%20SERIES.pdf
i gave pin16 of lcd gnd and pin15 VCC for the backlight.
what could be the problem?
My project is interfacing a keypad & LCD with microcontroller i.e i press the button on my keypad and the LCD displays the number and number of times the key is pressed.
If you see the above code,it uses a header file lcd.h
The code for the header file is:
Code dot - [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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 //LCD Module Connections extern bit RS; extern bit EN; extern bit D0; extern bit D1; extern bit D2; extern bit D3; extern bit D4; extern bit D5; extern bit D6; extern bit D7; //End LCD Module Connections void Lcd_Delay(int a) { int j; int i; for(i=0;i<a;i++) { for(j=0;j<100;j++) { } } } //LCD 8 Bit Interfacing Functions void Lcd8_Port(char a) { if(a & 1) D0 = 1; else D0 = 0; if(a & 2) D1 = 1; else D1 = 0; if(a & 4) D2 = 1; else D2 = 0; if(a & 8) D3 = 1; else D3 = 0; if(a & 16) D4 = 1; else D4 = 0; if(a & 32) D5 = 1; else D5 = 0; if(a & 64) D6 = 1; else D6 = 0; if(a & 128) D7 = 1; else D7 = 0; } void Lcd8_Cmd(char a) { RS = 0; // => RS = 0 Lcd8_Port(a); //Data transfer EN = 1; // => E = 1 Lcd_Delay(5); EN = 0; // => E = 0 } Lcd8_Clear() { Lcd8_Cmd(1); } void Lcd8_Set_Cursor(char a, char b) { if(a == 1) Lcd8_Cmd(0x80 + b); else if(a == 2) Lcd8_Cmd(0xC0 + b); } void Lcd8_Init() { Lcd8_Port(0x00); RS = 0; Lcd_Delay(200); ///////////// Reset process from datasheet ///////// Lcd8_Cmd(0x30); Lcd_Delay(50); Lcd8_Cmd(0x30); Lcd_Delay(110); Lcd8_Cmd(0x30); ///////////////////////////////////////////////////// Lcd8_Cmd(0x38); //function set Lcd8_Cmd(0x0C); //display on,cursor off,blink off Lcd8_Cmd(0x01); //clear display Lcd8_Cmd(0x06); //entry mode, set increment } void Lcd8_Write_Char(char a) { RS = 1; // => RS = 1 Lcd8_Port(a); //Data transfer EN = 1; // => E = 1 Lcd_Delay(5); EN = 0; // => E = 04 } void Lcd8_Write_String(char *a) { int i; for(i=0;a[i]!='\0';i++) Lcd8_Write_Char(a[i]); } void Lcd8_Shift_Right() { Lcd8_Cmd(0x1C); } void Lcd8_Shift_Left() { Lcd8_Cmd(0x18); } //End LCD 8 Bit Interfacing Functions
The only change i made is connect pin 3 of lcd i.e vee to +VCC=5V due to unavailability of a potentiometer.
I simulated the circuit with the code on Proteus software and it works like a charm--perfect!
but now when i supply power to circuit, the lcd displays black boxes..
lcd is jhd162a
here's the link for its datasheet:
http://www.itron.com.cn/PDF_file/JHD162A%20SERIES.pdf
i gave pin16 of lcd gnd and pin15 VCC for the backlight.
what could be the problem?
Last edited by a moderator: