LCD HD44780 0x86

Discussion in 'Embedded Systems and Microcontrollers' started by stmp44, Jul 23, 2009.

  1. stmp44

    Thread Starter New Member

    Jul 17, 2009
    8
    0
    I have a program for 8051 were many instructions are being passed to lcd at (0x86); and it is being sent when rs = 0 , means it should be taken as command not data

    sorry for my ignorance, but what does (0x86) mean ? what is the program trying to do with that
     
  2. stmp44

    Thread Starter New Member

    Jul 17, 2009
    8
    0
    anyone ? please help
     
  3. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    Your question is not clear and its hard to figure out what exactly you want to know.
    Are you asking what resides at location 0x86 in the 8051,
    or how will the LCD interpret 0x86 passed to it as data,
    or are you asking what 0x86 means without reference to either LCD or 8051 commands.

    A sample of the code might help us understand what your question is about.
     
  4. mauro.laurenti

    Active Member

    May 8, 2009
    68
    0
    I would suggest do download the HD44780 datasheet (no the LCD datasheet) and check what 0x86 means if sent as command. Just take the command spec and see what happen if you send the bits 1000 0110 (which is 0x86).

    Ciao,

    Mauro
     
  5. stmp44

    Thread Starter New Member

    Jul 17, 2009
    8
    0
    I want to ask that how LCD will interpret it, I am not sure if it is getting passed as data or as command, You can see the code at http://www.microdigitaled.com/8051/Code/Example%2012-2.txt

    lcdcmd is being called like

    Code ( (Unknown Language)):
    1. lcdcmd(0x06);
    2. lcdcmd(0x86);
    I just want to know what are these statements doing
     
    Last edited: Jul 24, 2009
  6. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    Take a look at the HD44780 datasheet, you can download it from http://fab.cba.mit.edu/classes/MIT/863.05/classes/11_14/44780.pdf If you are working with HD44780 controlled LCDs this document is required reading.

    You will see that command 0x06 sets the cursor to increment after each character and command 0x86 sets the DDRAM address to 0x06.

    You can work out any other command for yourself using the above document.
     
  7. stmp44

    Thread Starter New Member

    Jul 17, 2009
    8
    0
    Thanks
    So In other words with lcdcmd(0x86); we are just telling the lcd that at what position it needs to print the character ?
     
  8. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    That is correct. You are telling it where to position the cursor.
     
  9. stmp44

    Thread Starter New Member

    Jul 17, 2009
    8
    0
  10. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    The MSDelay() function is a mSec delay routine. It consists of two loops, the outside loop takes the value passed to the function to tell it how many times to perform the inside loop.

    The inside loop loops around 1275 times which the author of the program has determined takes his processor 1 mSec. If your clock speed is different to the author's you may have to tweak this value.

    So if you wanted a 2mSec delay you would pass the value 2 to MSDelay() when you called it I.E. you would call
    MSDelay(2);
     
  11. baysidebecca

    New Member

    Jul 14, 2009
    7
    0
    The delay is needed to meet the timing specs for the character display. LCD character displays are orders of magnitude slower than microcontrollers and microprocessors.
     
Loading...