Jman 31
Member level 2
Hi Guys,
I am working on the programming for this circuit. I decided to simplify it to the most basic form. Starting with getting the LCD working. I have done plenty with LCD's on the Arduino so I have a good idea of how they work.
I am having trouble getting the programming to work.
Here is the circuit:
and here is the simple program that I am trying to run:
I have compiled it and it compiles fine. I used the default device flags that come with MikroC. I then programmed it with my PICKit2 and it programmed fine.
I am getting a row of white boxes across the top of the LCD which means that the LCD is not initializing. Does anyone have any idea what i could be doing wrong?
Thanks
J
I am working on the programming for this circuit. I decided to simplify it to the most basic form. Starting with getting the LCD working. I have done plenty with LCD's on the Arduino so I have a good idea of how they work.
I am having trouble getting the programming to work.
Here is the circuit:
and here is the simple program that I am trying to run:
Code:
/*
* Project name:
Lcd_Test (Simple demonstration of the LCD Library functions)
* Copyright:
(c) MikroElektronika, 2005-2008
* Description:
This is a simple demonstration of LCD library functions. LCD is first
initialized, then some text is written at the first row.
* Test configuration:
MCU: PIC16F628A
Oscillator: HS, 08.0000 MHz
Ext. Modules: LCD 2x16
SW: mikroC v8.0
* NOTES:
None.
*/
char *text = "mikroElektronika";
void main() {
Lcd_Config(&PORTB, 5, 6, 0, 4, 3, 2, 1); // Lcd_Init_EP5, see Autocomplete
LCD_Cmd(LCD_CLEAR); // Clear display
LCD_Cmd(LCD_CURSOR_OFF); // Turn cursor off
LCD_Out(1,1, text); // Print text to LCD, 1st row, 1st column
Delay_ms(1000);
LCD_Out(2,6,"mikroE"); // Print text to LCD, 2nd row, 6th column
}
I have compiled it and it compiles fine. I used the default device flags that come with MikroC. I then programmed it with my PICKit2 and it programmed fine.
I am getting a row of white boxes across the top of the LCD which means that the LCD is not initializing. Does anyone have any idea what i could be doing wrong?
Thanks
J