Está en la página 1de 3

!!! IMPORTANT !!!

< WHEN INTERFACING WITH PARALLEL PORT, DONOT, IN ANY


cIRCUMTANCES FORGET TO CONNECT THE GND-WIRE OF
PARALLEL PORT WITH external supply's GND >
============================================================================

sequence of Control signals for lcd at initialization:


********************************************************

1. <RS=Low>
2. Function set <eg: 00111000 = 8bit,2line,5x7dots>
3. Send *enable pulse <delay -> enable-high -> delay -> enable-low ->delay>
4. <RS=Low>
5. Display,Cursor,Blinking-Cursor Set <eg: 000001110 = ON,ON,OFF resp.>
6. Send *enable pulse <delay -> enable-high -> delay -> enable-low ->delay>
7. <RS=Low>
8. Entry mode set <always: 00000110 = ? Cursor in incrment position,Shift
invisible>
9. Send *enable pulse <delay -> enable-high -> delay -> enable-low ->delay>
10. <RS=Low>
11. Clear Display < 00000001 = Clear Display>
12. Send *enable pulse <delay -> enable-high -> delay -> enable-low ->delay>

To write data:
****************

1. <rs=high>
2. Output charchter ascii in bin to data o/p to parallel port <eg. : 90=Z
,01011010>
3. Send *enable pulse <delay -> enable-high -> delay -> enable-low ->delay>
4. IMPORTANT! : If some charachters appears to be missing then try increasing the
delay time.So as to give the lcd enought time for processing.
5. If required to work in Nibble mode:
As the lcd initializes auto. in 8.bit mode,but we hav connected only
4lines(i.e: D7-DD4) So we can act like, like we using all 8lines
and sending (while keeping rs => low) 00100000 or 0010xxxx (which is the
function command.Bit4 is telling to function as 4.bit
interference. So thats how using 4lines the inteference is switched from 8bit
to 4bit pretending to use 8lines. Then as after that
4bit interference is activated we can again send the function instruction in
nibble form to set the 1line/2line, 5x7/5x10 dots settings
by:
i) rs = low
ii) Send 0010xxxx to data output of parallel port <where '0010' is the higher
nibble of function instruction "00101000">
iii) then send 1000xxxx <where '1000' is lower nibble of the function instruction
"00101000">
iv) And like that other control commands and data(to be printed) can be
transmitted in the same way.

Setting position of the cursor:


********************************

Character# : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Line 1 ---- x x x x x x x x x x x x x x x x
Line 2 ---- x x x x x x x x x x x x x x x x
Line 3 ---- x x x x x x x x x x x x x x x x
Line 4 ---- x x x x x x x x x x x x x x x x

Position of the cursor can set by writing control commands to the ddram(data
display ram) by Sending (while rs low)
128 + 'charchter number' (10xxxxxx x=>is the no count on lcd in binary )
according to the lcd charachter count for setting cursor to any char of 1st line.
& 192 + 'charchter number' (11xxxxxx x=>is the no count on lcd in binary )
according to the lcd charachter count for setting cursor to any char of 2nd line.
******************************************************************************
*******************************************************************************
20 + 'charchter number' according to the lcd charachter count for setting
cursor to any char of 3rd line.
84 + 'charchter number' according to the lcd charachter count for setting
cursor to any char of 4th line.

Note : I think that in


16x1 > there is memorey for 40/80 charchters of which 16 are displayed and
others can be scrolled to.
16x2 > on a single line there is memorey for 40 charchters of which 16 are
displayed and others can be scrolled to.
20x4 > on a single line there is memorey for 20 charchters of which 20 are
displayed.(i.e exactly same no as char display no.)

Custom Charachter generation:


********************************

As the custom generated charachters are stored in CGRAM (& Only till lcd is
powered on), there is only from 00000000 to 00000111 (0 to 7 of ascii code)
is reserved for Custom Chars. Means that after generating the chars, we can
access those chars sending (0 to 7 ascii to o/p port).

1001 0100

* Doesn't matter if the present state of the enable is 1 or 0.

Timing:
*********
Most of the instructions execute in less than 40us, but clear and home take as
much as 1.64ms. So delay must be enough to let the process complete.

2.5.2 Addressing Display RAM


----------------------------
In the list below, "line 1" is the topmost line, and "line n" is the bottommost
line. On each line, the leftmost character has the lowest address, and addresses
increase to the right. Also, DD RAM addresses are shown without the 80h mode bit
set.

16x1 module is arranged as two 8-character lines side by side.


"Line 1" (left) addresses are 00h to 07h
"Line 2" (right) addresses are 40h to 47h
As you write characters to the module, the cursor will
automatically increment until you get to the 9th
character--you have to move the cursor to address 40h
before writing the 9th character on the 1x16 module.

16x2 module is two lines by 16 chars


Line 1 addresses are 00h to 0Fh
Line 2 addresses are 40h to 4Fh

20x1 module
Line 1 addresses are 00h to 13h

20x2 module
Line 1 addresses are 00h to 13h
Line 2 addresses are 40h to 53h

20x4 module
Line 1 addresses are 00h to 13h
Line 2 addresses are 40h to 53h
Line 3 addresses are 14h to 27h
Line 4 addresses are 54h to 67h

40x2 module
Line 1 addresses are 00h to 27h
Line 2 addresses are 40h to 67h
The full 128 bytes of display RAM exist no matter how many characters appear on
the display. These extra bytes can be typed on when display window scrolling is
enabled, or they can be used to store other information--external data RAM for the
CPU, if you like.