burrow
Full Member level 2
- Joined
- Dec 15, 2014
- Messages
- 147
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 18
- Activity points
- 1,148
Well, i ran into a problem which many other beginners face while interfacing pic with lcd. i googled and checked solution given in all forums and i cant still get it to work.
Iam using pic18f4520.
The lcd iam using is JHD162A.
My Mikroc program to check lcd is
I tried with many combination of delays etc.
Wiring is okay, i checked the connection twice or thrice . Connection sees alright.
but i see only boxes.
iam using pic internal oscillator, and frequency iam using is 4mhz
I am using pot for contrast pin.
And yea lcd is working with other pic.
Iam using pic18f4520.
The lcd iam using is JHD162A.
My Mikroc program to check lcd is
Code:
sbit LCD_RS at RC2_bit;
sbit LCD_EN at RD2_bit;
sbit LCD_D4 at RD0_bit;
sbit LCD_D5 at RC5_bit;
sbit LCD_D6 at RC0_bit;
sbit LCD_D7 at RC1_bit;
sbit LCD_RS_Direction at TRISC2_bit;
sbit LCD_EN_Direction at TRISD2_bit;
sbit LCD_D4_Direction at TRISD0_bit;
sbit LCD_D5_Direction at TRISC5_bit;
sbit LCD_D6_Direction at TRISC0_bit;
sbit LCD_D7_Direction at TRISC1_bit;
void main() {
TRISB=0b00000000;
Delay_ms(100);
Delay_ms(100);
Delay_ms(100);
Delay_ms(100);
Delay_ms(100);
Delay_ms(100);
Lcd_Init(); // Initialize LCD
Delay_ms(100);
Delay_ms(100);
Delay_ms(100);
Lcd_Cmd(_LCD_CLEAR); // Clear display
Delay_ms(100);
PORTB=0b11111111;
while(1)
{
Lcd_Out(1,3,"Helllooooo");
PORTB=0b00000000;
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Delay_ms(100);
Delay_ms(100); Delay_ms(100);
PORTB=0b11111111;
Delay_ms(100); Delay_ms(100);
Delay_ms(100);
}
}
I tried with many combination of delays etc.
Wiring is okay, i checked the connection twice or thrice . Connection sees alright.
but i see only boxes.
iam using pic internal oscillator, and frequency iam using is 4mhz
I am using pot for contrast pin.
And yea lcd is working with other pic.