Ernestas
Newbie level 4

Hello, bought PIC programer(mikroProg) from mikroElektronika and i have some problems with LCD could you help me out?
Im using PIC16F628A and Hitachi HD44780 LCD. My code in C looks like this :
I used this code in Proteus simulator and it have worked, but when i try in real life LCD screen show me only black boxes. I dont use external oscilliator maybe this is the problem? And i cant make RA0 and RA1 digital output. ANSEL = 0; dont work.. Could you help me out? Thank you.
Im using PIC16F628A and Hitachi HD44780 LCD. My code in C looks like this :
Code:
sbit LCD_RS at RA0_bit;
sbit LCD_EN at RA1_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISA0_bit;
sbit LCD_EN_Direction at TRISA1_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
char txt3[] = "Good job!!";
void main() {
CMCON = 111;
CCP1CON = 0;
INTCON = 0;
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
while(1){
Lcd_Out(1, 1,txt3);
};
}
Last edited by a moderator: