Hi all,I am new to this forum.I interfaced pic18f4550 microcontroler to lcd ,I wrote the c program and compiled it in mikro c compiler.The code I compiled was example provided by mikroc. it was actually written for pic18f8520 I changed to 18f4550 in the project window.the problem is, i am not getting anything on the screen.can anyone help to solve this problem?
The oscillator used is crystal 8Mhz
trim pot 5k to contrast change.
lcd(16*2 display) similar to hd44780,it has 8 data bits d0 to d7,vcc,vss,backlight led all similar to hd44780.
The c program is below
/*
* Project name:
Lcd_Test (Simple demonstration of the LCD Library functions)
* Copyright:
(c) MikroElektronika, 2005.
* Description:
This is a simple demonstration of LCD library functions. LCD is first
initialized (PORTB, 4-bit data interface, default pin settings), then some
text is written at the first row.
* Test configuration:
MCU: P18F8520
Dev.Board: BIGPIC4
Oscillator: HS, 10.0 MHz
Ext. Modules: LCD
SW: mikroC v8.0
* NOTES:
None.
*/
char *text = "mikroC_123";
void main() {
unsigned short btnRes;
CMCON |= 0x07; // turn off comparators
ADCON1 |= 0x0F; // turn off analog input // disable external memory bus
Lcd_Custom_Config(&PORTb, 7,6,5,4,&PORTb, 2,4,3); // Initialize LCD connected to PORTH
Lcd_Custom_Cmd(LCD_CLEAR); // Clear display
Lcd_Custom_Cmd(LCD_CURSOR_OFF); // Turn cursor off
Lcd_Custom_Out(1,1, text); // Print text to LCD, 2nd row, 1st column
Lcd_Custom_Chr_CP('@');
Lcd_Custom_Chr(1,14, '#');
Lcd_Custom_Cmd(LCD_SECOND_ROW);
Lcd_Custom_Out_CP(text);
while (1) ; // endless loop
}//~!
The oscillator used is crystal 8Mhz
trim pot 5k to contrast change.
lcd(16*2 display) similar to hd44780,it has 8 data bits d0 to d7,vcc,vss,backlight led all similar to hd44780.
The c program is below
/*
* Project name:
Lcd_Test (Simple demonstration of the LCD Library functions)
* Copyright:
(c) MikroElektronika, 2005.
* Description:
This is a simple demonstration of LCD library functions. LCD is first
initialized (PORTB, 4-bit data interface, default pin settings), then some
text is written at the first row.
* Test configuration:
MCU: P18F8520
Dev.Board: BIGPIC4
Oscillator: HS, 10.0 MHz
Ext. Modules: LCD
SW: mikroC v8.0
* NOTES:
None.
*/
char *text = "mikroC_123";
void main() {
unsigned short btnRes;
CMCON |= 0x07; // turn off comparators
ADCON1 |= 0x0F; // turn off analog input // disable external memory bus
Lcd_Custom_Config(&PORTb, 7,6,5,4,&PORTb, 2,4,3); // Initialize LCD connected to PORTH
Lcd_Custom_Cmd(LCD_CLEAR); // Clear display
Lcd_Custom_Cmd(LCD_CURSOR_OFF); // Turn cursor off
Lcd_Custom_Out(1,1, text); // Print text to LCD, 2nd row, 1st column
Lcd_Custom_Chr_CP('@');
Lcd_Custom_Chr(1,14, '#');
Lcd_Custom_Cmd(LCD_SECOND_ROW);
Lcd_Custom_Out_CP(text);
while (1) ; // endless loop
}//~!