Problem with 1x16 LCD

Discussion in 'General Electronics Chat' started by Maged A. Mohamed, Jun 3, 2011.

  1. Maged A. Mohamed

    Thread Starter Member

    Apr 6, 2011
    I made a simple temperature alarm with 89c52 and LMB161 1x16 LCD
    the problem is the LCD displays data on the left 8 locations only, even increasing contrast affects only those locations, while the rest looks not connected.
    I tried a small initialization program and manipulated all bits in data sheet, but nothing seems to have any effect on them.
    I thought the display is bad so I got from another vendor JHD161A which is the same.
    Repeating all steps now using the JHD161A data sheet, the same results

    The only time I get full 16 characters, if I cut power then put on quickly several times, it may happen and stays that way as long as power is on, then back to 8 characters again.

    I went to the vender asking if anyone solved that problem, he said, they normally buy 2x16 and this display is not sold often.
    Please Help
  2. SgtWookie


    Jul 17, 2007
    Your power may be coming up to operating voltage too slowly; so your LCD might be left in an uninitialized state.

    You might monitor the state of the power supply, and wait to start communicating with the LCD for at least 15mS after the power is good (close to the normal operating voltage).

    Then proceed with the software initialization as documented in the datasheet:
    The 8-bit initialization starts on page 13, 4-bit on page 14.

    Are you certain of your MCU's clock speed? Are you certain that your timing loops are accurate? You have to delay a number of mS (see datasheet) between each initialization command, and check the busy flag before writing more commands.
  3. Maged A. Mohamed

    Thread Starter Member

    Apr 6, 2011
    Thanks a lot for replying
    I used a delay loop before staring the initialization code about 0.5 second as first part in the program, reduced the clock from 4.4M to 3 Meg, even used the reset button to further delay starting, finally reset should start the software initialization, but nothing seem to have any effect
    I used the timing provided by Batronix designed for 12 MHz clock on my 3 Meg clock and further increased the loop count to increase the time , not you see the display write a character them moves to next as a long periodes
    The only thing I will do is as you said check the busy flag, it may have unlisted feature that helps

    Best regards and thanks
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    OK, so HALF the display works normally? You send some text and that exact text appears? That does not sound like a timing problem or a hardware problem.

    I know on some of the 4x20 displays I used in the dim past there were gaps in the memory where the character codes were stored. So perhaps try just sending letters to the display to every address possible by letting the address pointer increment along.

    I'm thinking perhaps the manufacturer uses an 8 by 4 display driver, so the second half of the line is not in a continuous memory location.

    Note: I think I found a reference to same problem here.
  5. Maged A. Mohamed

    Thread Starter Member

    Apr 6, 2011
    Thank you very much,

    1st it seems that every display number have different memory locations for display, I have 3 different sets now, I will try this new set. I used a continous writing program but did not access the 2nd 8 locations.

    2nd I may find the solution in this link you provided, i.e. sending command for a second line

    I will try and report back

    Best regards and thanks again very much
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    Lots of old 1x16 displays have the characters set up as 2x8.

    If you use code from a driver that runs 2x8 display or 2x16 it will work fine.

    If you want to modify your code, the second 8 characters start at the second display line. The hex address for the start of the second line (I can't remember) but it is shown in the 44780 datasheet.