+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 4
    Points: 45, Level: 1

    Join Date
    Oct 2015
    Posts
    5
    Helped
    0 / 0
    Points
    45
    Level
    1

    HD44780 LCD problems

    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 FvM; 5th October 2015 at 11:10. Reason: Added code tags

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 77,678, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,737
    Helped
    3586 / 3586
    Points
    77,678
    Level
    67

    Re: HD44780 LCD problems

    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


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Super Moderator
    Points: 29,619, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,858
    Helped
    1114 / 1114
    Points
    29,619
    Level
    41
    Blog Entries
    9

    Re: HD44780 LCD problems

    Another factor that also make black boxes is the LCD contrast not properly polarized.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 4
    Points: 12,536, Level: 26
    Achievements:
    Created Blog entry 7 years registered
    thannara123's Avatar
    Join Date
    Jan 2010
    Location
    Nedumkandam, India, India
    Posts
    1,431
    Helped
    118 / 118
    Points
    12,536
    Level
    26
    Blog Entries
    2

    Re: HD44780 LCD problems

    Check LCD contrast and crystal value ,connections
    I Respect You



--[[ ]]--