I am using a PIC18F2550 uC to interface with JHD162A LCD..
My Connections are as Follow:-
LCD uC
1 GND
2 VCC(5V)
3 VCC
4 RB4
5 GND
6 RB5
7 GND
8 GND
9 GND
10 GND
11 RB0
12 RB1
13 RB2
14 RB3
15 VCC(5V)
16 GND
OSCILLATOR Frequency = 4MHz
My Program is as Follow:-
Code: Select all
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections
char txt1[] = "GOD is Great";
char txt2[] = "-By Arun";
void main() {
ADCON0 = 0x00; // Configure AN pins as digital I/O
ADCON1 |= 0x0F; // Configure AN pins as digital
CMCON |= 7; // Disable comparators
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,2,txt1); // Write text in first row
Delay_ms(2000);
Lcd_Out(2,4,txt2); // Write text in second row
Lcd_Cmd(_LCD_CLEAR); // Clear display
}
But I am not getting any Output on LCD..
Can any help me..?