chimera786
Member level 2
Hello. Here is the background: bought an HD44078 compatible 16x2 LCD from ebay (cheap). It arrived yesterday and I wrote a very simple code to see if the LCD works. Before actually wiring it up with the PIC, I wrote the program and ran it on Proteus Isis; the programs worked.
When I built it, the LCD doesnt show anything. The screen shows random blocks, lines..basically..junk. This leads me to believe that the LCD is not even initializing.
What am doing wrong. I have looked carefully at the portB pins and they do not have comparators or analog inputs multiplexed to them.
Is the inbuilt LCD library in MikroC not working -- I mean, the timing sequences used in the LCD library by MikroC are not compatible with the LCD that I am currently using? ---> possibility?
USING: PIC16F818, MikroC Pro compiler, LCD 16x2 (HD44078) compatible (atleast according to the ebay seller :-?) and I have wired the thing up correctly
When I built it, the LCD doesnt show anything. The screen shows random blocks, lines..basically..junk. This leads me to believe that the LCD is not even initializing.
What am doing wrong. I have looked carefully at the portB pins and they do not have comparators or analog inputs multiplexed to them.
Is the inbuilt LCD library in MikroC not working -- I mean, the timing sequences used in the LCD library by MikroC are not compatible with the LCD that I am currently using? ---> possibility?
USING: PIC16F818, MikroC Pro compiler, LCD 16x2 (HD44078) compatible (atleast according to the ebay seller :-?) and I have wired the thing up correctly
Code:
// Lcd pinout settings
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;
// Pin direction
sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;
void main() {
OSCCON=0x74; // 8Mhz OSC
Delay_ms(500);// just in case to see if the LCD needed some extra time to settle down after start up
Lcd_Init();
Delay_ms(500);
}
Last edited: