[SOLVED] PIC 16F877 interface with LCD 2 x 16

Status
Not open for further replies.

WStevens_sa

Member level 2
Joined
Jan 5, 2011
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
South Africa
Activity points
1,695
Hi all

Trying to figure out how to send info to LCD 2x16. Running a bit into a snag. The code below I found on the web. I am trying to understand the methods of communication with an LCD using f877. I am using Real Pic Simulator 1.3 to simulate.

First problem On compiling "MikroC"
8 393 'lcd_cmd' Identifier redefined LCD 2 x 6.c

Second problem I cannot Identify which pins from the f877 go to where on the LCD. I have a feeling that the pins are already configured somewhere else and this is why it complains about the "Identifier redefined"

 


I think problem … built in functions you are redefined.


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;

void main(){
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,1,"Hi WStevens_sa ");
Lcd_Out(2,1,"It's Simple");

}

 
You are 100% right Denshil. Thanks for the help.

I found this with the pin outs. If anybody else has this problem. This is the most basic of connecting LCD to 887.

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…