Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] problem with PIC18F450_LCD Interface

Status
Not open for further replies.
Joined
Sep 2, 2015
Messages
2
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Location
Mumbai
Activity points
0
Here is my code...

Code:
// Configuration bits
/* _CPUDIV_OSC1_PLL2_1L,  // Divide clock by 2
   _FOSC_HS_1H,           // Select High Speed (HS) oscillator
   _WDT_OFF_2H,           // Watchdog Timer off
   MCLRE_ON_3H            // Master Clear on
*/

//LCD Control pins
#define rs LATA.F0
#define rw LATA.F1
#define en LATA.F2

//LCD Data pins
#define lcdport LATB

void lcd_ini();
void lcdcmd(unsigned char);
void lcddata(unsigned char);
unsigned int i=0;

void main(void)
{
	TRISA=0;		// Configure Port A as output port
	LATA=0;
	TRISB=0;		// Configure Port B as output port
	LATB=0;
	lcd_ini();		// LCD initialization
	lcddata('E');		// Print 'E'
	Delay_ms(1000);
	lcdcmd(0x85);		// Position 1st Line, 6th Column
	lcddata('G');		// Print 'G'

}
void lcd_ini()
{
	lcdcmd(0x38);		// Configure the LCD in 8-bit mode, 2 line and 5x7 font
	lcdcmd(0x0C);		// Display On and Cursor Off
	lcdcmd(0x01);		// Clear display screen
	lcdcmd(0x06);		// Increment cursor
	lcdcmd(0x80);		// Set cursor position to 1st line, 1st column
}

void lcdcmd(unsigned char cmdout)
{
	lcdport=cmdout;		//Send command to lcdport=PORTB
	rs=0;						
	rw=0;
	en=1;
	Delay_ms(10);
	en=0;
}

void lcddata(unsigned char dataout)
{
	lcdport=dataout;	//Send data to lcdport=PORTB
	rs=1;
	rw=0;
	en=1;
	Delay_ms(10);
	en=0;
}


can you please help me..
LCD is not at all reponding.
 
Last edited by a moderator:

pic.programmer

Advanced Member level 3
Joined
Aug 19, 2015
Messages
773
Helped
141
Reputation
284
Reaction score
140
Trophy points
43
Activity points
7,542
Mention the compiler used. Your delay function and #defines look like mikroC PRO code. If you are using mikroC PRO then it has a LCD library. If you are not using mikroC then mention your compiler. Post your circuit.
 

Joined
Sep 2, 2015
Messages
2
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Location
Mumbai
Activity points
0
i am using PIC18F4550 Controller with MPLAB IDE, PICKIT3..

Lcd.h is required ?
 
  • Like
Reactions: KYP

    KYP

    Points: 2
    Helpful Answer Positive Rating

pic.programmer

Advanced Member level 3
Joined
Aug 19, 2015
Messages
773
Helped
141
Reputation
284
Reaction score
140
Trophy points
43
Activity points
7,542
Zip and post your complete MPLAB project files and also mention your Compiler.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top