+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Newbie level 5
    Points: 1,412, Level: 8

    Join Date
    Jul 2005
    Posts
    9
    Helped
    2 / 2
    Points
    1,412
    Level
    8

    trouble with HD44780 driver with PIC

    Hi,
    I've just began to work with microcontrollers and i've built a simple HD44780 LCD driver with a PIC microcontroller but i have some trouble in the module initialization. I've used a library a found on the net and that is like the one that come with the CCS PCW compiler but u can choose the pins u want to use.
    It works but only when the timing is really accurate like when i turn it on it just initializes and the cursor stays blinking in a aleatory place of the display. I have to reset the PIC in order to get the characters to show up in the display correctly.
    The library is attached.

    P.S: I've already added delay routines before and after i call the lcd_init().
    The commentaries on the library are in portuguese.
    It uses the 4 bit mode.

    •   AltAdvertisement

        
       

  2. #2
    Full Member level 3
    Points: 3,390, Level: 13

    Join Date
    Dec 2001
    Location
    Just behind You ;-)
    Posts
    187
    Helped
    9 / 9
    Points
    3,390
    Level
    13

    Re: trouble with HD44780 driver with PIC

    Before initializing the LCD, you have to wait about 100 mSec after power ON, in order to allow the HD44780 controller to wakeup and gain the LCD system control.

    The accurate time to wait after Power ON can be obtained easily from the HD44780 datasheet.

    I can attach it for you if u wish.

    Yours,


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Newbie level 5
    Points: 1,412, Level: 8

    Join Date
    Jul 2005
    Posts
    9
    Helped
    2 / 2
    Points
    1,412
    Level
    8

    Re: trouble with HD44780 driver with PIC

    Yes, thanks but i am already doing that in fact i'm waiting even more 500ms i guess i have already tried to mix with the delay routines but without success.



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 5
    Points: 15,172, Level: 29
    VVV's Avatar
    Join Date
    Nov 2004
    Posts
    1,582
    Helped
    383 / 383
    Points
    15,172
    Level
    29

    Re: trouble with HD44780 driver with PIC

    It seems to me the initialization is incorrect. D5 and D4 should be 1, not 0, as in the code.
    Check the datasheet, page 213 (fig. 26) and make sure you follow those steps.
    If you need the datasheet, I can post it.



  5. #5
    Newbie level 5
    Points: 1,412, Level: 8

    Join Date
    Jul 2005
    Posts
    9
    Helped
    2 / 2
    Points
    1,412
    Level
    8

    Re: trouble with HD44780 driver with PIC

    well the initialization sends 0x03 three times then send 0x02 as i have seen in many data around the net. It then sends this
    "byte CONST INI_LCD[4] = {0x20 | (lcd_type << 2), 0xf, 1, 6}; "

    just like the library in the PCW compiler any idea why it doesn't works, VVV?



--[[ ]]--