EDE701.PDF

(176 KB) Pobierz
EDE701 Serial LCD Interface IC
EDE701
0=2400,1=9600
1
BAUD
POLARITY
+5V*
+5V
GND
Enable
RS
RW
N/C
OUT
RCV
OSC1
OSC2
+5V
D7
D6
D5
D4
18
17
16
15
14
13
12
11
10
Digital Output
Serial Receive
Oscillator Connection
Oscillator Connection
Connect to +5V DC
LCD Data Pin 7
LCD Data Pin 6
LCD Data Pin 5
LCD Data Pin 4
0=Inverted,1=Standard
2
Connect to +5V DC*
Connect to +5V DC
Digital Ground
LCD Enable Line
LCD RS Line
LCD RW Line
No Connection
3
4
5
6
7
8
9
The EDE701 Serial LCD Interface IC has been designed to provide a cost-effective LCD control
solution for a wide variety of embedded designs. Offering the most frequently used features of both
our EDE700 and EDE702 IC's, the EDE701 provides a tremendous price/ performance ratio. It
allows nearly any text-based LCD module to be controlled via a simple one-wire data link, freeing
an additional 6 to 10 I/O lines on your microcontroller/ microprocessor system - which frequently
allows a smaller, less costly microcontroller to be utilized in your design.
The EDE701 allows full LCD control, including the creation of custom characters. The EDE701 also
provides a convenient serial-controlled digital output pin for lighting an indicator LED, driving a
sounder, controlling LCD backlighting, etc. Also, in addition to the usual sideways-scrolling feature
standard on most LCD modules, the EDE701 is also capable of shifting text from the bottom row of
a 2-row LCD to the top row upon reception of a CR or LF command. With a 2400 or 9600 Baud
rate and selectable serial data polarity, the EDE701 can easily communicate with any device
capable of sending asynchronous serial data. Connection to most microcontrollers, stamps, or
microprocessors can be made using a single data wire without any type of voltage level conversion.
Connection to a PC requires only a 33KΩ resistor.
Some of the special features included in the EDE701 are:
RS232 and TTL-level compatible
Single-chip design allows for easy system integration
Compatible with most 1x8 to 2x40 character HD44780 controlled LCDs
Useable with LCDs having either 1x14 or 2x7 connector configuration
Allows direct control of all LCD functions
"Row Shift-up" functionality
Selectable data polarity eliminates necessity of RS-232 voltage converter
Serially-controlled digital output pin
2400/9600 Baud data rates
Available in 18 pin DIP or SOIC packages
Cost-effective in OEM applications
Copyright
©
1999 E-Lab Digital Engineering, Inc. All Rights Reserved.
Page 1
PIN DEFINITIONS
LCD Module Connection Pins
LCD Enable Line (Pin 6): .....................................
LCD Enable line;
pin 6 on LCD screen module
LCD RS Line (Pin 7): ...........................................
LCD Register Select line;
pin 4 on LCD screen module
LCD RW Line (Pin 8):..........................................
LCD Read/Write line;
pin 5 on LCD screen module
D4 (Pin 10): ........................................................
LCD Data 4 line;
pin 11 on LCD screen module
D5 (Pin 11): ........................................................
LCD Data 5 line;
pin 12 on LCD screen module
D6 (Pin 12): ........................................................
LCD Data 6 line;
pin 13 on LCD screen module
D7 (Pin 13): ........................................................
LCD Data 7 line;
pin 14 on LCD screen module
BAUD (Pin 1):.....................................................
Baud Rate Selection;
0 = 2400, 1 = 9600 Baud
Polarity (Pin 2):...................................................
Serial Data Polarity Control;
0 = Inverted, 1 = Standard
RCV (Pin 17):......................................................
Serial Data Input
OUT (Pin 18): .....................................................
Digital Output (not necessary to connect)
EDE701 Control & Data Pins
OSC1,OSC2 (Pin 16, Pin 15): ..............................
20 MHz Resonator Connection
+5V Power (Pin 14, Pin 4):.................................
Connect to +5V DC
Ground (Pin 5):...................................................
Connect to 0 VDC (GND)
+5V or GND (Pin 3): .........................................
* To maintain pin compatibility with EDE700 &
702, may be connected to either +5V or GND
EDE701 Clock/ Power Pins
PC CONNECTION
The EDE701 can be used with most HD44780-based text LCD's. The two most common types of
connectors on these modules are the 1x14 and 2x7 pin arrangements (there may be two additional
pins if the LCD is the backlit type). The pin numbers should be identified on the LCD module.
Refer to Figure One for connection of the LCD module to the EDE701. Notice that not all of the
LCD module's pins need to be connected, as the EDE701 uses a 4-bit transfer mode.
Figure One also illustrates the hookup used for connection to a PC. A RS-232 voltage-level
converter IC such as the MAX232 is not required; internal clamping diodes on the EDE701 convert
the incoming RS-232 level voltages into TTL-level signals. Also, notice that the POLARITY input on
the EDE701 is tied low; this causes the EDE701 to interpret the inverted RS-232 signals correctly (a
voltage-converter IC such as the MAX232, inside the PC, inverts the signal during transmission).
* IMPORTANT NOTE:
The 33KΩ resistor must be used when connecting to a PC in this fashion;
omitting it will cause excessive current to flow, possibly damaging both the PC serial port and the
EDE701 IC.
Copyright
©
1999 E-Lab Digital Engineering, Inc. All Rights Reserved.
Page 2
Figure One: Connection of EDE701 to a PC using only a 33K
Resistor
A 4 MHz resonator is used to clock the EDE701. Alternately, you may choose to use a 4 MHz
crystal (parallel-cut) or a 4 MHz TTL oscillator. If you choose the latter, connect the oscillator
output to only OSC1 (Pin 16), leaving OSC2 (Pin 15) unconnected. The LCD contrast is set by a
10-20KΩ potentiometer. If the LCD screen will be used in a relatively temperature-constant
environment with a fixed viewing angle, you may choose to replace this potentiometer with two
suitably-valued resistors connected in series. The contrast pin would then be connected between
the two resistors (use a potentiometer to first determine the appropriate resistance values for your
particular LCD).
The above schematic can be easily tested using the following QBASIC code; both the PC-
executable and text versions are available on E-Lab's web site:
REM Open communication channel to COM1 at 9600 Baud
OPEN "com1:9600,n,8,
1,cd0,cs0,ds0,op0,rs" FOR OUTPUT AS #1
REM Clear Display
GOSUB 999
OUT &H3F8, &HFE
GOSUB 999
OUT &H3F8, &H1
REM Pause for LCD screen clear command to complete on LCD module
FOR delay=1 to 5000: NEXT delay
REM Write first row of text to LCD screen
GOSUB 999
PRINT #1, "EDE701 Test Screen";
REM Jump to second row on 2 line LCD
GOSUB 999
OUT &H3F8, &HFE
GOSUB 999
OUT &H3F8, &HC0
REM Write second row of text to LCD screen
GOSUB 999
PRINT #1, "Time is: "; TIME$;
END
REM Hold until Tra
nsmit Buffer is empty
999 IF (INP(&H3FD) AND &H40) = 0 THEN GOTO 999
RETURN
CONNECTION TO OTHER HOST SYSTEMS
Most applications of the EDE701 will not involve connection to a PC. The EDE701 can be utilized
with a variety of controllers such as the BASIC Stamp™, nearly any microcontroller, or a
microprocessor system. The type of connection used (direct wire or RS-232 voltage level
Copyright
©
1999 E-Lab Digital Engineering, Inc. All Rights Reserved.
Page 3
conversion IC's) is determined by the communications level voltage of the host system. For
instance, the PC serial port transmits using voltages ranging from -15 to +15 VDC. The schematic
in Figure One relies on the EDE701's internal input-clamping diodes to reduce the signal's voltage
to TTL-levels. The 33KΩ resistor is necessary to limit the current through these diodes. Because the
voltage driver inside the PC contains a level inverter, the EDE701 is used in "Inverted Mode" (Pin 2
Low). This causes the EDE701 to transmit and receive using a polarity-inverted serial data stream.
If your EDE701 circuit does use a voltage-converter IC such as the MAX232, you will not need this
33KΩ series resistor. Also, since the MAX232 Level Shifter IC contains an inverter, the EDE701
should be operated in "Standard Mode" (Pin 2 High).
Connection to a microcontroller requires no voltage level conversion or current-limiting resistor;
simply connect the microcontroller's serial output to the EDE701's Serial Data Input (Pin 17). The
serial data is transmitted using TTL-compatible voltage levels. Depending upon the length of the
data line, you may need to pull up this line using a 4.7KΩ resistor, as shown in Figure Two. Figure
Two illustrates the connection of a BASIC Stamp™ I to the EDE701. Notice that only one I/O pin is
required to display text on the LCD screen. For this example, the EDE701 is set to 2400 Baud (Pin
1 Low), Standard Polarity (Pin 2 High).
Figure Two: Connection of EDE701 to BASIC Stamp™ I
The following software, written for the BASIC Stamp™ I, will output text on both lines of a two-line
LCD. Notice that a "Pause 10" instruction is added after each write to the LCD internal control to
allow time for the LCD to execute the instruction.
REM Delay while LCD powers up
PAUSE 500
REM Clear display and home cursor
SEROUT 7,T2400,($FE)
SEROUT 7,T2400,($01)
PAUSE 10
SEROUT 7,T2400,("Hello World...")
REM Move to start of second row
SEROUT 7,T2400,($FE)
SEROUT 7,T2400,($C0)
PAUSE 10
SEROUT 7,T2400,("This text should be on the second row!")
Copyright
©
1999 E-Lab Digital Engineering, Inc. All Rights Reserved.
Page 4
The following section outlines the use and function of the EDE701 LCD controller. While this
datasheet explains many of the specific LCD module features, your particular module may be
slightly different. When in doubt, always refer to the datasheet for your particular LCD module. In
addition, note that some one-line LCD modules do not have the entire row mapped contiguously in
memory; you must move the cursor position to the start of the LCD memory's "second line" in
order to write to the second half of the locations on these one-line displays.
USING THE EDE701 SERIAL LCD CONTROLLER
The EDE701 can be written to in much the same way as a terminal display device. It accepts
standard ACSII characters and writes them to the display screen. In addition, the EDE701 will
interpret several ASCII control commands and perform specific functions as directed by them. This
section details the use of the various commands available on the EDE701.
Upon powerup, your host controller (the device writing to the EDE701) should be programmed to
wait approximately 50 mS for the LCD to initialize. Following this, the display is ready to accept
data for display. Before the first character is written, the EDE701 will home the cursor (the cursor
will be invisible). Therefore, the first character written to the EDE701 will be displayed in the
upper-left hand corner of a two row display, or in the left-most position of a one-row display.
Subsequent character writes to the EDE701 will cause the cursor location to increment by one for
each character written.
Most ASCII characters can be displayed on the LCD module using the EDE701 (see your LCD
module datasheet for a complete listing). However, the EDE701 will intercept certain ASCII control
characters and not display them on the screen, instead performing a specific command upon the
LCD module. The following table shows the ASCII codes that will be intercepted by the EDE701:
Value
$0D
$0A
$0C
$08
$FE
ASCII Command
Carriage Return
Line Feed
Form Feed
Backspace
EDE701 Control
Function Performed
If previous character was LF, print nothing. Otherwise,
shift row 2 to row 1 and put cursor at start of row 2.
If previous character was CR, print nothing. Otherwise,
shift row 2 to row 1 and put cursor at start of row 2.
Clear screen, home cursor.
Perform destructive backspace (move cursor back one
position, and erase character in that position).
Read next command and perform desired function.
Table One: ASCII Control Characters
As can be see from Table One, either a Carriage Return (CR) or a Line Feed (LF) sent to the EDE701
causes it to copy the text on the second row of the LCD module to the top row, clear the second
row, and place the cursor at the start of the second row. Because many systems send both the
CR/LF combination at the end of a row of text, the EDE701 will only act upon one of these two
commands if they are sent one immediately following the other. Your host system may need to
delay a brief period while this action is performed.
Sending the Form Feed character to the EDE701 causes it to clear the screen and home the cursor.
The Backspace command causes the cursor to be moved back by one space (on a given row),
deleting the character that was in that position (commonly called a "destructive backspace").
Notice that the last command, $FE, has special meaning to the EDE701. It is used to issue direct
commands to the LCD module. The following table shows the direct commands that can be sent
after sending the value $FE (1111 1110 binary, 254 decimal) to the EDE701:
Copyright
©
1999 E-Lab Digital Engineering, Inc. All Rights Reserved.
Page 5
Zgłoś jeśli naruszono regulamin