View attachment 67045Hello all,
I try to have the message display on the 2x16 lcd, but show nothing. In proteus it does show perfectly what I want it to show, but when I implemented with the real chip, it does not show anything. I did play with the contract... but it only show blank square dot.
Thank you for your help.
here is the code and schematic:
// LCD module connections
sbit LCD_RS at RC5_bit;
sbit LCD_EN at RC4_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_RS_Direction at TRISC5_bit;
sbit LCD_EN_Direction at TRISC4_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections
void main()
{
TRISA = 0xFF; // PORTA is input except RA4
ANSEL = 0x03; // Configure AN0, AN1, pin as analog
// (Without this also could cause controller received data whlst busy msg)
PORTC = 0; // Set all pins on PORTC to low
TRISC = 0; // All of PORTC are outputs
lcd_cmd(0x20); // 4-bit mode - 2 line - 5x7 font.
delay_ms(1000);
lcd_init();
delay_ms(1000);
//lcd_cmd(0x28); // 4-bit mode - 2 line - 5x7 font.
LCD_cmd(_LCD_TURN_ON);
delay_ms(100);
LCD_cmd(_LCD_CLEAR); // Clear LCD
delay_ms(100);
LCD_cmd(_LCD_CURSOR_OFF);
delay_ms(100);
do
{
Lcd_Out(1,1,"Welcome to LCD");
lcd_out(2,1,"and PIC16f684");
delay_ms(1000);
} while(1);
}
I try to have the message display on the 2x16 lcd, but show nothing. In proteus it does show perfectly what I want it to show, but when I implemented with the real chip, it does not show anything. I did play with the contract... but it only show blank square dot.
Thank you for your help.
here is the code and schematic:
// LCD module connections
sbit LCD_RS at RC5_bit;
sbit LCD_EN at RC4_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_RS_Direction at TRISC5_bit;
sbit LCD_EN_Direction at TRISC4_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections
void main()
{
TRISA = 0xFF; // PORTA is input except RA4
ANSEL = 0x03; // Configure AN0, AN1, pin as analog
// (Without this also could cause controller received data whlst busy msg)
PORTC = 0; // Set all pins on PORTC to low
TRISC = 0; // All of PORTC are outputs
lcd_cmd(0x20); // 4-bit mode - 2 line - 5x7 font.
delay_ms(1000);
lcd_init();
delay_ms(1000);
//lcd_cmd(0x28); // 4-bit mode - 2 line - 5x7 font.
LCD_cmd(_LCD_TURN_ON);
delay_ms(100);
LCD_cmd(_LCD_CLEAR); // Clear LCD
delay_ms(100);
LCD_cmd(_LCD_CURSOR_OFF);
delay_ms(100);
do
{
Lcd_Out(1,1,"Welcome to LCD");
lcd_out(2,1,"and PIC16f684");
delay_ms(1000);
} while(1);
}