INTERFACING LCD MODULE TO 8086
Introduction:
     LCD or Liquid Crystal Display is an output
device used in many processor based applications
like calculators, Xerox machines, speedometers etc.
The 8086 kit, which you use in the lab, also uses a
LCD display to view the data entered into and
coming out of the processor.
Types of LCD Modules:
                            2 X 16 LCD
                            2 Lines
                             16 characters per
                         line
                                4 lines
                                40 characters per
                         line
                            4 lines
                            20 characters per
                  line
Pin diagram of HD44780 LCD module:
 Pin No.     Notation         Description
    1          Vss              Ground
    2          Vdd                +5V
    3           VEE         Contrast Adjust
                            Register Select
                            Control input = 0
    4           Rs
                                Data input      =
                        1
                              Read Write
    5          R/W         Read from LCD = 1
                            Write to LCD = 0
    6           E               Enable
                               Data Bus
  7  14      D0  D7          LSB = Pin7
                              MSB = Pin14
Brief description of LCD module:
    Every LCD display system will have following
components:
  1. Display Screen
      a. Single or multiple lines
      b. Multiple characters per line
  2. Cursor
      a. Blinking cursor or Stable cursor
      b. Right moving cursor or left moving cursor
  3. Each character can be displayed by using
      a. 5 X 10 dots or
      b. 5 X 7 dots
  4.Interface to the processor
      a. 4 line interface or
      b. 8 line interface
     So there are number of possibilities coming
up when you attempt to use any LCD. You have to
address these prior to displaying anything.
       Every LCD module has a controller built inside
it. This controller incorporates two RAMs
  a. Control RAM
  b. Data RAM
    Initially you send a series of control words
each specifying in which of above 4 functionalities
you want to configure the LCD device. Control
words are sent to control RAM.
 Once configured you transmit actual data to Data
 RAM which ultimately appears on the screen.
 Format of control words:
      Unlike other devices the LCD module can be
 configured with several control words. Each
 control word will be specific to each of the
 possible functionality. The following table will
 illustrate type of control word formats to be sent
 to Control RAM to get the assigned functionality.
 Here only a few control word formats are given.
 In practice there are more control words.
                             D   D     D   D   D   D   D   D
         Command
                             7   6     5   4   3   2   1   0
                                           D
        Function Set         0   0     1       N   F   X   X
                                           L
   Enable Display/ Cursor    0   0     0   0   1   D   C   B
       Clear Display         0   0     0   0   0   0   0   1
                                               S   R
        Move Cursor          0   0     0   1           X   X
                                               C   L
 X = dont care bits : means they can either be 0 or 1.
 Function Set:
 DL Data Bus Line: The LCD module allows you to use
 either 8 bit data line or 4 bit data line
                 DL = 1   8 bit data bus
                    0 4 bit data bus
N No. of lines: Using this bit you can specify either you
want to display characters in two lines or in a single line
                  N=1      2 line display
                      0 1 line display
F display format: In a LCD display each character is
displayed by activating individual dots on the surface. You
have two options:
                      1 5 X 10 dot matrix format   (F = 1)
                      2 5 X 7 dot matrix format ( F = 0 )
Enable Display/ Cursor:
D=1      Display on
  0 Display off
C=1      Cursor on
  0 Cursor off
B=1      Cursor Blink on
  0 Cursor Blink off
Move Cursor:
SC = 1      Shift cursor on
   0 Shift cursor off
RL = 1         Move cursor right after the display of each
character
   0 Move cursor left after the display of each character
So this is about format of different control words. Once
you are acquainted in this let us go for hardware
connection diagram to implement the interface.
Port A to 8 bit data bus of LCD
Port C0 to Enable bit of LCD
Port C1 to RW of LCD
Port C2 to RS of LCD
 Procedure to interface LCD in 8 bit mode to 8086
  1. Configure 8255
     Port A and C in output mode = 80H
     Port C in BSR mode. Because you are using
     individual port bits to send control signals viz.
     E, RW and RS.
       a. To write to LCD i.e to display data
Microprocessor and Microcontroller
                           Assignment III
                                             By,
                                     C.R.Sridhar,
                         S.Naga Subramanian,
                               S.Naresh Ajay.