I wrote the following code to display a blinking text on an lcd. The code works properly on the simulator but the real lcd doesn't display anything. I attached the circuit diagram I used to connect the lcd. I would really appreciate it if someone could tell me what did I do wrong.
[![// LCD module connections
sbit LCD_RS at PORTD.B2;
sbit LCD_EN at PORTD.B3;
sbit LCD_D4 at PORTD.B4;
sbit LCD_D5 at PORTD.B5;
sbit LCD_D6 at PORTD.B6;
sbit LCD_D7 at PORTD.B7;
sbit LCD_RS_Direction at TRISD.B2;
sbit LCD_EN_Direction at TRISD.B3;
sbit LCD_D4_Direction at TRISD.B4;
sbit LCD_D5_Direction at TRISD.B5;
sbit LCD_D6_Direction at TRISD.B6;
sbit LCD_D7_Direction at TRISD.B7;
// End LCD module connections][1]][1]
char MyFirstText[] = "Hello ";
void main(){
Lcd_Init();
Lcd_Cmd(_LCD_CURSOR_OFF);
while(1)
{
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,6,"Hello ");
Lcd_Out(2,6,"World");
Delay_ms(100);
}
}
P.S: I don't have a 10k potentiometer so I connected a 5k instead.
Lcd_Cmd(_LCD_CLEAR);
because I need the text to blink. I could increase the delay though but the things is my lcd doesn't respond at all so I think it might be connection problem. \$\endgroup\$