Continue to Site

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] PIC + LCD (H44780) + Hi-tech compiler

Status
Not open for further replies.

sumiii

Junior Member level 3
Joined
Apr 4, 2011
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,490
Please check the logic of this code . there is no error in compilation.But it LCD display is blank ...I have attached the simulation of proteas

).
Here you can see that at data pins of LED char 'A'(65) is coming and LCD is on but no dispaly Please help.
Thanks



#include <hitech.h>
#include <pic18.h>


#define LCD_RS RB0
#define LCD_EN RB1

#define LCD_DATA PORTD




void lcd_writee(unsigned char c);
void lcd_write(unsigned char c);


void main()
{


TRISD= 0x00 ;
TRISB= 0x00 ;
PORTD = 0x00 ;
PORTB = 0x00 ;


_delay(250); //delay for LCD Power Up

lcd_write(0x38); // define 8 bit interface,2 lines. 5x7 dots
_delay(250);

lcd_write(0x0C); //display on, cursor on, blink off
_delay(250);

lcd_write(0x01); //clear screen
_delay(250);

lcd_write(0x06); //entry mode set
_delay(250);

lcd_write(0x00+ 0x80);
_delay(250);

lcd_write(0x80) ; //select first line
lcd_writee('A') ;
_delay(250);

}

/* write a byte to the LCD in 8 bit mode */
void lcd_cmd(unsigned char c)
{
LCD_RS =0;
LCD_DATA=c ;
LCD_EN=1 ;
_delay(250);
LCD_EN=0 ;
}
void lcd_data(unsigned char c)
{
LCD_RS =1;
LCD_DATA=c ;
LCD_EN=1 ;
_delay(250);
LCD_EN=0 ;
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top