Arduino Projects    |   Raspberry Pi  |     Electronic Circuits   |    AVR    |    PIC    |    8051    |    Electronic Projects

PIC18F4550 interface with LCD 20x4 liner in MikroC

2 posts / 0 new
Last post
raize
raym_0109's picture
Offline
Joined: 13/08/2011
Posts: 2
Points: 380
PIC18F4550 interface with LCD 20x4 liner in MikroC

Hi everyone, I'm newbie in this forum..we have this  GSM based project which will interface with the LCD and a keypad.. we are having a problem interfacing the LCD to the microcontroller using the MikroC..The LCD does'nt display the code that we have burned to the PIC, we just use the built in function of the MikroC and it works fine in proteus but if we implement it on the hardware, it does'nt work.  It only display the boxes in the row 1 and row 3.  

 

 

 

 

 

LCD that we have if we display the simple "Hello World"

 

 

 

 

 

 

 

 

 

 

 

here is our code, please check if what are the problems:

 

 

sbit LCD_RS at RD2_bit;
sbit LCD_RD at RD1_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
 
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_RD_Direction at TRISD1_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
 
 
 
 
// End LCD module connections
char txt10[] = "HELLO WORLD";
 
 
void main(){
  ADCON1 = 0x7F;
  CMCON = 0x07;
  TRISD = 0x00;
  ADRESH = 0;                        // Configure AN pins as digital I/O
  ADRESL = 0;
  LCD_RD_Direction = 1;
  LCD_RD = 0;
  delay_ms(2000);
  Lcd_Init();                        // Initialize LCD
  delay_ms(2000);
  Lcd_Out_Cp(txt10);
 
 
}
 
Hoping for your positive response..Thanks You!! =)
raize
raym_0109's picture
Offline
Joined: 13/08/2011
Posts: 2
Points: 380

Please really need your help.

Login or register to post comments
You are here