sumiii
Junior Member level 3
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 ;
}
).
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 ;
}