I have a problem with MikroC for AVR when i write code for LCD. Although it's compiled successful, but when i run simulation on ISIS, it notice error "[HD44780] Controller received data whilst busy" , LCD white screen and not display text i printed.
Code: Select all
sbit LCD_RS at PORTC2_bit;
sbit LCD_EN at PORTC3_bit;
sbit LCD_D7 at PORTC4_bit;
sbit LCD_D6 at PORTC5_bit;
sbit LCD_D5 at PORTC6_bit;
sbit LCD_D4 at PORTC7_bit;
sbit LCD_RS_Direction at DDC2_bit;
sbit LCD_EN_Direction at DDC3_bit;
sbit LCD_D7_Direction at DDC4_bit;
sbit LCD_D6_Direction at DDC5_bit;
sbit LCD_D5_Direction at DDC6_bit;
sbit LCD_D4_Direction at DDC7_bit;
void main() {
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Delay_ms(500);
UART1_Init(9600);
Delay_ms(100);
Lcd_Out(1,1,"UART TEST");
while (1) {
Lcd_Chr(2,1,"DISPLAY TEST");
Delay_ms(1000);
}
}