LCD2041 Technical Manual Revision: 2.
Contents Contents 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 2 3 5 6 6 Hardware Information 2.1 DB-9 Connector . . . . . . . . . . . . . 2.1.1 Power Through DB-9 Jumper .
5.9 5.10 5.11 5.12 5.13 5.14 5.15 6 7 8 9 Go Home . . . . . . . . . Move Cursor Back . . . . Move Cursor Forward . . . Underline Cursor On . . . Underline Cursor Off . . . Blinking Block Cursor On Blinking Block Cursor Off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10 Miscellaneous 10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.2 Read Version Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.3 Read Module Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 39 40 40 11 Command Summary 11.1 Communications . . . . 11.2 Text . . . . . . . . . . . 11.3 Special Characters . . . 11.4 General Purpose Output . 11.5 Display Functions . . . . 11.
1 Getting Started Figure 1: LCD2041-WB The LCD2041 is an intelligent LCD display designed to decrease development time by providing an instant solution to any project. With the ability to communicate via serial RS-232/TTL and I2 C protocols, the versatile LCD2041 can be used with virtually any controller. The ease of use is further enhanced by an intuitive command structure to allow display settings such as backlight brightness, contrast and baud rate to be software controlled.
Figure 2: LCD2041 Options 1.2 Accessories NOTE Matrix Orbital provides all the interface accessories needed to get your display up and running. You will find these accessories and others on our e-commerce website at http://www.matrixorbital.com. To contact a sales associate see Section 12.6 on page 51 for contact information.
Figure 6: Serial Cable 4FT Figure 5: Breadboard Cable Figure 7: Communication and 5V Power Cable 1.3 • • • • • Features 20 column by 4 line alphanumeric liquid crystal display Selectable communication protocol, serial at RS-232 or TTL levels or I2 C Three, 5V -20mA, general purpose outputs for a variety of applications Lightning fast communication speeds, up to 57.6 kbps for RS-232 and 100 kbps for I2 C Default 19.
Figure 8: Aluminum Mountings Figure 9: Mounting Kits Matrix Orbital LCD2041 4
• • • • • • • • 1.
1.5 Installing the Software 1.5.1 uProject uProject was designed by Matrix Orbital to provide a simple and easy to use interface that will allow you to test all of the features of our alpha numeric displays. To install uProject from the Matrix Orbital CD, follow the following steps: 1. 2. 3. 4. Insert the Matrix Orbital CD-ROM into the CD drive Locate the file, uProject.exe, which should be in the “CD-drive:\Download” directory. Copy uProject.exe to a directory that you wish to run it from.
2 Hardware Information Refer to the following diagram for this chapter: 1 DB-9 Connector 2 Power Through DB9 Jumper 3 GPOs 4 Manual Override 5 Power / Data Connector 6 Legacy Connector Jumper 7 Protocol Select Jumpers Figure 12: LCD2041 2.1 DB-9 Connector The LCD2041 provides a DB-9 Connector to readily interface with serial devices which use the EIA232 standard signal levels of ±12V to ±12V. It is also possible to communicate at TTL levels of 0 to +5V by setting the Protocol Select Jumpers to TTL.
Pin 2 Pin 3 Pin 5 Pin 9 Tx \ SDA (I2 C data) Rx \ SCL (I2 C clock) GND PWR (Must solder Power Through DB9 Jumper. See table 1 on page 10 for power requirements.) Figure 13: RS-232 Pin out 2.1.1 Power Through DB-9 Jumper In order to provide power through pin 9 of the DB-9 Connector you must place a solder jumper on the Power through DB-9 Jumper pictured in figure 14 below.
Matrix Orbital LCD2041 9
WARNING Do not apply voltage through pin 9 of the DB-9 connector AND through the Power/Data Connector at the same time. 2.2 Power/Data Connector The Power/Data Connector provides a standard connector for powering the display module. The LCD2041 requires five volts for the standard display module, between nine to fifteen for the wide voltage (V) and between nine to thirty-five volts for the wide voltage with efficient power supply module (VPT).
2.2.1 Legacy Data Connector Jumpers To reverse pins two and three of the Power/Data Connector remove the zero ohm resistors from the Legacy Data Connector Jumpers, labeled with the = symbol and place them on the jumpers labeled with the X symbol. This will allow you to transmit on pin two, and receive data on pin three instead of the default of receiving on pin two and transmitting on pin three of the Power/Data Connector.
Matrix Orbital LCD2041 12
2.4 General Purpose Outputs A unique feature of the LCD2041 is the ability to control relays and other external devices using a General Purpose Output, which can provide up to 20 mA of current and +5Vdc from the positive side of the GPO. If the device, which is being driven by a GPO, requires a relatively high current (such as a relay) and has an internal resistance of its own greater than 250 ohms, then the 240 ohm resistor, which is associated with the GPO may be removed and replaced with a Jumper.
Matrix Orbital LCD2041 14
Table 2: Default Values Contrast 128 Backlight 255 Baud Rate 19.2 kbps I2 C Slave Address 0x50 Data Lock False RS232AutoTransmitData True NOTE The display module will revert back to the old settings once turned off, unless the settings are saved. 3 Troubleshooting 3.1 The display does not turn on when power is applied. • First, you will want to make sure that you are using the correct power connector.
3.3 The display module is communicating, however text cannot be displayed. • A common cause may be that the contrast settings have been set to low. The solution to this problem is to adjust the contrast settings. The default setting that will work in most environments is 128. NOTE Optimal contrast settings may vary according to factors such as temperature, viewing angle and lighting conditions. If you are unable to resolve any issue please contact Matrix Orbital. See 12.
that the transmission is over. The LCD2041 has some speed limitations, especially when run in I2 C mode. Here are some considerations when writing I2 C code: * to be able to read the replies of query commands (eg. cmds 54, 55) the following command must be sent (only needs to be sent once, so this can be done somewhere in init): 254 / 160 / 0 this command puts the reply data in the I2 C output buffer instead of the RS232 output buffer.
4.2 Changing the I2 C Slave Address Syntax Parameters Description Hexadecimal Decimal ASCII Parameter adr 0xFE 0x33 [adr] 254 51 [adr] 254 “3” [adr] Length Description 1 The new I2 C write address (0x00 0xFF). This command sets the I2 C write address of the module between 0x00 and 0xFF. The I2 C write address must be an even number and the read address is automatically set to one higher. For example if the I2 C write address is set to 0x50, then the read address is 0x51.
Description This command sets the RS-232 port to the specified [speed]. The change takes place immediately. [speed] is a single byte specifying the desired port speed. Valid speeds are shown in the table below. The display module can be manually reset to 19,200 baud in the event of an error during transmission, including transmitting a value not listed below, by setting the manual override jumper during power up.
Examples Crystal Speed 16 Mhz Desired BAUD 13,500 speed = crystalspeed −1 8 ∗ DesiredBaud speed = 148.15 − 1 speed = 16, 000, 000 −1 8 ∗ 13, 500 speed = 147.15 • LSB = 0x93 (rounded) • MSB = 0x00 • Intended Baud Rate: 13,500 baud Actual Baud Rate: 16,000,000 =13,514 Percent Difference: 0.1% 8(147+1) NOTES • Results from the formula are rounded down to the nearest whole number (i.e 73.07 = 73). • This formula becomes less acurate as baud rates increase, due to rounding.
5.1.1 Character Set Figure 20: Character Set 5.1.2 Control Characters In addition to a full text set, the LCD2041 display supports the following ASCII Control characters: 0x08 Backspace 0x0C Clear screen / New page 0x0D Carriage return 0x0A Line feed / New line 5.
Syntax Description Remembered Default 5.3 Description Remembered Hexadecimal 0xFE 0x52 Decimal 254 82 ASCII 254 “R” When auto scrolling is disabled the text will wrap to the top left corner of the display area when the text reaches the end of last row. Yes Clear Screen Description Hexadecimal 0xFE 0x58 Decimal 254 88 ASCII 254 “X” This command will immediately clear all of the contents of the display. Remembered No Syntax 5.5 Yes On Auto Scroll Off Syntax 5.
5.6 Set Auto Line Wrap On Syntax Description Hexadecimal 0xFE 0x43 Decimal 254 67 ASCII 254 “C” Enabling Auto Line Wrap will allow the cursor to automatically wrap over to the next line when the current line is full. NOTE Line wraps may occur in the middle of a word. Remembered 5.7 Set Auto Line Wrap Off Syntax Description Remembered 5.8 Yes Hexadecimal 0xFE 0x44 Decimal 254 68 ASCII 254 “D” Disabling Auto Line Wrap will allow you to change the line configuration.
Description This command will allow you to manually set the cursor position, which controls the text insertion point, by specifying the [col] and [row] of the new proposed cursor position. NOTE If the cursor position is set past the end of a line it will wrap to the beginning of the next line. Remembered 5.
Description This command will move the cursor forward one space. If this command is sent when the cursor is at the bottom right position the cursor will wrap back to the home position if line wrap is on. Sending this command will not effect the text displayed on the module, however any characters that are sent will over write the current characters that are being displayed. Remembered No 5.
Description Hexadecimal 0xFE 0x54 Decimal 254 84 ASCII 254 “T” This command will turn the block cursor off. Remembered Yes Syntax 6 6.1 Special Characters Introduction The LCD2041 has the ability to create four different sets of eight custom characters and save them to internal banks of memory. Each set of eight can be recalled from memory at any time, and selected characters can be written to the display screen.
Description The LCD2041 allows for upta to eight custom defined characters to be added onto the the character set. A custom character is a five by eight pixel matrix with each row represented by a byte value. For example: 1 1 1 1 1 1 1 1 Remembered 6.
Description New to the LCD2041 has added five non-volatile memory banks for custom character storage. This is intended to allow you to create your own custom bar graphs, medium/large numbers and startup screen. However, each memory bank may be used to store a set of any eight custom characters; with the only provision being that memory bank zero contains the characters that will be used in the startup screen. By default the memory banks will be loaded as follows: [Bank] 0 1 2 3 4 Remembered 6.
Description Using this command you may create the custom characters. that will be stored in memory bank zero, which will be used in the startup screen. For more information about creating custom characters see Section 6.2 on page 26. NOTES • Changes only take place once the power has been cycled. • This command is the same as sending CMD 254 / 193 / 0 / [ID] / [DATA] Remembered 6.6 Initialize Medium Number Syntax Description Remembered 6.
6.8 Initialize Large Numbers Syntax Description Remembered 6.9 Hexadecimal 0xFE 0x6E Decimal 254 110 ASCII 254 “n” This command will load the default large number characters into the volatile memory. If you have stored your own custom large numbers, use the ’Load Custom Characters’ command instead to load your custom character data into the volatile memory. This command will allow you to use the ’Place Large Numbers’ command.
6.11 Place Horizontal Bar Graph Syntax Parameters Description Hexadecimal Decimal ASCII Parameter Col Row Dir 0xFE 0x7C [Col] [Row] [Dir] [Length] 254 124 [Col] [Row] [Dir] [Length] 254 “|” [Col] [Row] [Dir] [Length] Length Description 1 The column number. 1 The row number. 1 The direction of the bar data (0 or 1). Length 1 The length of the bar data. This command will place a bar graph at [row], [column]. A [Dir] value of zero will cause the bar to go right, and one will cause the bar to go left.
Syntax Description Hexadecimal 0xFE 0x76 Decimal 254 118 ASCII 254 “v” This command will load the wide vertical bar characters into the volatile memory. If you have stored your own custom vertical bar data, use the ’Load Custom Characters’ command instead to load your custom bar data into the volatile memory. This command will allow you to use the ’Place Vertical Bar’ command. NOTE Wide bars have a width of five pixels. Remembered No 6.
7.2 General Purpose Output Off Syntax Parameters Description Hexadecimal 0xFE 0x56 [Num] Decimal 254 86 [Num] ASCII 254 “V” [Num] Parameter Length Description Num 1 GPO number. This command turns OFF general purpose output [num]. NOTE OFF means that the output is pulled HIGH. Remembered 7.3 Yes General Purpose Output On Syntax Parameters Description Hexadecimal 0xFE 0x57 [Num] Decimal 254 87 [Num] ASCII 254 “W” [Num] Parameter Length Description Num 1 GPO number.
Description This command will set the startup state for the GPO on the next power up. A value of one will cause the GPO to be off on the next startup while a value of one will cause the GPO to be on. NOTE This command does not affect the current state of the GPO. Remembered 8 8.
8.4 Description This command turns the backlight off immediately. The backlight will remain off until a ’Display On’ command has been received. Remembered Yes Set Brightness Syntax Parameters Description Remembered Default 8.5 0xFE 0x99 [brightness] 254 153 [brightness] Length Description 1 Display brightness setting (0 to 255). This command sets the display [brightness]. If the remember function is on, this command acts the same as ’Set and Save Brightness’.
Description This command sets the display’s contrast to [contrast], where [contrast] is a value between 0x00 and 0xFF (between 0 to 255). Lower values cause ‘on’ elements in the display area to appear lighter, while higher values cause ‘on’ elements to appear darker. Lighting and temperature conditions will affect the actual value used for optimal viewing. Individual display modules will also differ slightly from each other in appearance.
9 9.1 Data Security Introduction Ensuring that your LCD2041 display’s exactly what you want it to can be the difference between a projects success and failure. This is why we incorporate features such as Data Lock into the LCD2041 With this new feature you now are in control over of how and when settings will be changed so there is no need to worry about the module acting exactly like you expected it to because all the settings may be locked and remembered for the next power up. 9.
9.3 Data Lock Syntax Parameters Hexadecimal Decimal Parameter level 0xFE 0xCA 0xF5 0xA0 [level] 254 202 245 160 [level] Length Description 1 Sets the data lock level Description Paranoia allows you to lock the module from displaying information, as well as enables the protection of the filesystem and module settings.
9.4 Set and Save Data Lock Syntax Parameters Description Remembered Default 9.5 Parameters Description Remembered Hexadecimal 0xFE 0x34 [data] Decimal 254 52 [data] ASCII 254 “4” [data] Parameter Length Description data 16 Writes the customer data Writes the customer Data. 16 Bytes of data can be saved in non-volatile memory. No Read Customer Data Description Hexadecimal 0xFE 0x35 Decimal 254 53 ASCII 254 “5” Reads whatever was written by Write Customer Data.
10.2 Read Version Number Syntax Description Hexadecimal 0xFE 0x36 Decimal 254 54 ASCII 254 “6” This command will return a byte representing the version of the module, see the following table as an example: Hex Value 0x19 0x57 Remembered Version Number Version 1.9 Version 5.7 No 10.
Description Remembered Matrix Orbital This command will return a hex value corresponding to the the model number of the module see the following table: Hex 1 5 7 9 B D F 13 15 21 23 25 27 29 2B 31 33 35 37 39 3B 3D 3F 41 43 45 47 49 4B 4D 4F 51 53 55 57 5B 71 73 77 79 No Product ID LCD0821 LCD2041 LCD4041 LK204-25 VFD2021 VFD4021 VK204-25 GLC24064 GLK24064-25 Unused Unused GLK24064-16-1U-USB GLK19264-7T-1U-USB GLK12232-16-SM LK204-7T-1U LK404-AT LK402-12 LK204-25PC VK202-24-USB VK204-24-USB VK162-12 PK2
11 Command Summary 11.
Description Move Cursor Back Move Cursor Forward Underline Cursor On Underline Cursor Off Blinking Block Cursor On Blinking Block Cursor Off Syntax Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII 0xFE 0x4C 254 76 254 “L” 0xFE 0x4D 254 77 254 “M” 0xFE 0x4A 254 74 254 “J” 0xFE 0x4B 254 75 254 “K” 0xFE 0x53 254 83 254 “S” 0xFE 0x54 254 84 254 “T” Page 24 24 25 25 25 25 11.
Description Initialize Horizontal Bar Place Horizontal Bar Graph Initialize Narrow Vertical Bar Initialize Wide Vertical Bar Place Vertical Bar Syntax Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII 0xFE 0x68 254 104 254 “h” 0xFE 0x7C [Col] [Row] [Dir] [Length] 254 124 [Col] [Row] [Dir] [Length] 254 “|” [Col] [Row] [Dir] [Length] 0xFE 0x73 254 115 254 “s” 0xFE 0x76 254 118 254 “v” 0xFE 0x3D [Column] [Length] 254 61 [Column]
Description Set Contrast Set and Save Contrast Syntax Hexadecimal Decimal ASCII Hexadecimal Decimal 0xFE 0x50 [contrast] 254 80 [contrast] 254 “P” [contrast] 0xFE 0x91 [contrast] 254 145 [contrast] Syntax Hexadecimal Decimal Hexadecimal Decimal Hexadecimal Decimal Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII 0xFE 0x93 [switch] 254 147 [switch] 0xFE 0xCA 0xF5 0xA0 [level] 254 202 245 160 [level] 0xFE 0xCB 0xF5 0xA0 [level] 254 203 245 160 [level] 0xFE 0x34 [data] 254 52 [data] 254 “4” [data] 0xFE
Command Hex 0x37 0x39 0x3D 0x40 0x42 0x43 0x44 0x46 0x47 0x48 0x4A 0x4B 0x4C 0x4D 0x4E 0x50 0x51 0x52 0x53 0x54 0x56 0x57 0x58 0x68 0x6D 0x6E 0x6F 0x73 0x76 0x7C 0x91 0x93 0x98 0x99 0xA4 0xC0 0xC1 0xC2 Description Page Dec ASCII 55 “7” 57 “9” 61 “=” 64 “@” 66 “B” 67 “C” 68 “D” 70 “F” 71 “G” 72 “H” 74 “J” 75 “K” 76 “L” 77 “M” 78 “N” 80 “P” 81 “Q” 82 “R” 83 “S” 84 “T” 86 “V” 87 “W” 88 “X” 104 “h” 109 “m” 110 “n” 111 “o” 115 “s” 118 “v” 124 “|” 145 147 152 153 164 192 193 194 0xC3 195 Matrix Orbital Read
12 Appendix 12.1 Specifications 12.1.1 Environmental Table 58: Environmental Specifications Standard Temperature Extended Temperature Operating Temperature 0◦ C to +50◦ C -20◦ C to +70◦ C ◦ ◦ Storage Temperature -20 C to +70 C -30◦ C to +80◦ C Operating Relative Humidity 90% max non-condensing Vibration (Operating) 4.9 m/s2 XYZ directions Vibration (Non-Operating) 19.6 m/s2 XYZ directions Shock (Operating) 29.4 m/s2 XYZ directions Shock (Non-Operating) 490 m/s2 XYZ directions 12.1.
NOTE To prolong life, it is recommended that the backlight be turned off when the display is not in use.
12.
12.4 Ordering Information LCD 1 20 2 4 3 1 4 -IY 5 -VPT 6 -E 7 Table 61: Part Numbering Scheme # 1 2 3 4 Description Screen Type Width Height GPO 5 Color (Text/Background) 6 Input Voltage 7 Temperature Options LCD: Liquid Crystal Display* 20: Twenty Character Columns 4: Four Character Rows 1: Single GPO NP: Standard Grey/Yellow-Green GW: Grey/White WB: White/Blue R: Red/Black IY: Yellow/Black NP: Standard (4.75-5.25V) -V: Extended Voltage (9.00-15.0V) -VPT: Wide voltage with ESPS (9.00-35.
12.6 Contacting Matrix Orbital Telephone Sales: 1(403)229-2737 Support: 1(403)204-3750 On The Web Sales: http://www.MatrixOrbital.com Support: http://www.MatrixOrbital.ca Forums: http://www.lcdforums.com 12.7 Revision History Revision 2.0 2.