Wierd LCD problem

Discussion in 'Embedded Systems and Microcontrollers' started by wannaBinventor, Sep 4, 2010.

  1. wannaBinventor

    Thread Starter Active Member

    Apr 8, 2010
    I've been working with 16x2 LCD displays for a while now and I've never had this problem. Long story short, I'm using a PIC16F818 and I had my LCD data lines attached to RB0-RB3 and as such configured the display for bytes coming in 2 nibbles. I need to use the SPI on the PIC which occupies RB1,2,5 and 6, so I set the LCD up for RB0,3,6,7. I underwent the painstaking process of converting the normal "4 bit RB0-RB3" literals into literals that would work for the current display set up.

    MOVLW 02H


    MOVLW 08H

    I was checking my characters by displaying ABCDEF..... and then breaking to go to the next line and putting more letters.

    All was fine with the letters, but I've noticed that this display seems to be shifting characters to the left about once every 3-5 seconds. Where it once said "ABCDEFG..." it will then say "BCFEFG....", and so on until there are no characters left and then it starts displaying jibberish. I just don't get this one.

    I'll spare you all the code as it is a PITA to read with the sending of the bytes separately and changing the standard addressing for the new pin setup. For what it's worth, I've recalculated the display configuration changes (IE 03h has become 09h) about 10 times. I was correct with all the characters, so I don't think my methodology would be wrong here, either.

    Is there a common cause for characters to be shifting left on an LCD (HD44780 type)?

    Last edited: Sep 4, 2010
  2. hgmjr

    Retired Moderator

    Jan 28, 2005
    There is an LCD command to auto-shift left or right as you have described. Do you suppose you have unintentionally enabled this LCD display feature?