Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

HD44780 LCD problems

Status
Not open for further replies.

Ernestas

Newbie level 4
Joined
Oct 5, 2015
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
63
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 :

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);
                            };
}
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.
 
Last edited by a moderator:

Hi,

did you read HD44780 datasheet about all the timings befor / during init phase?

The black boxes indicate that it is not initialized correctely.

Klaus
 
Another factor that also make black boxes is the LCD contrast not properly polarized.
 

Check LCD contrast and crystal value ,connections
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top