I am designing a digital clock using 89s52 and lcd. My simulation on proteus is working perfectly, now i try to implement it on breadboard but the lcd is not giving me any response, i have double checked my connection. This is my first implemention of a circuit using lcd, what am i not doing well?
LCD initialization may not be perfect....This may be the reason.
try this steps for initialization in 4 bit mode. I also faced same problem. I made many modifications in my program and finally i works..
This is a part of my final code related to LCD in 4 bit mode.
/////////////////////////////////////////////////////////////////
void LCD_STROBE(void)
{
EN = 1;
__delay_us(0.5);
EN = 0;
}
///////////////////////////////////////////////////////////////////
void data(unsigned char c)
{ RS=1;
__delay_us(40);
PORTB = ( c >> 4 );LCD_STROBE();
PORTB = ( c );LCD_STROBE();
}
///////////////////////////////////////////////////////////////////
void cmd(unsigned char c)
{ RS=0;
__delay_us(50);
PORTB = ( c >> 4 );LCD_STROBE();
__delay_us(5);
PORTB = ( c );LCD_STROBE();
__delay_us(5);
}
//////////////////////////////////////////////////////////////////
void clear(void)
{
org 00h
ljmp main
org 003h
ljmp rest
org 0013h
ljmp est
main: call initialize_lcd
mov ie,#85h ;configuring interrupt 0 and 1.
setb tcon.0 ;enabling interrupt 0. Used to set the minutes
setb tcon.2 ;enabling interrupt 1. Used to set the hour.
contrast pin should be connected to a potentiometer.. one end to +5V other end to ground and middle pin to Port pin and contrast pin ... dont forget to use pull up resistor for all port pins of 10K....
unable to open the circuit... pin 1 and 16 gnd and pin 2 and 15 to vcc
I am designing a digital clock using 89s52 and lcd. My simulation on proteus is working perfectly, now i try to implement it on breadboard but the lcd is not giving me any response, i have double checked my connection. This is my first implemention of a circuit using lcd, what am i not doing well?
Ok...ur ciruit works perfectly on Proteus then it means that there is no issue with the code[Stage one completed].
There can be few chances due to which ur LCD isn't working:
1. The Pin Configuration which u defined in the Code is by mistake not being used by u.
2. Check the sequence of the pin numbers(LCD). Might possible u have inserted wires in reverse order i-e u would have inserted Data Pins wires in Rs/RW/E/Vcc etc pins and vice versa.So i recommend u better check the pin sequence.
3. Might possible that you haven't provided the required Vcc or Vcc .
4. Last but no the least check ur LCD. Might possible its faulty from inside or its Vcc pin or RW pin are faulty ones.
contrast pin should be connected to a potentiometer.. one end to +5V other end to ground and middle pin to Port pin and contrast pin ... dont forget to use pull up resistor for all port pins of 10K....
unable to open the circuit... pin 1 and 16 gnd and pin 2 and 15 to vcc
some lcd have 16 pins and some have 14 pins. if it is 14 pins then 16 is internally shorted to 1 and 15 is shorted to 2.. dont worry about that.....
In proteus it will work .. but in practical life as i told you have to connect a pull up resistor of 10k resistor to each port pin.. when you use potentiometer to pin 3 of lcd and tune it then you should see black box appear on lcd.