LCD2041 User Manual LCD2041 rev 2 1
Table of Contents 1. Introduction ........................................................................................................................................... 4 1.1 1.2 1.3 1.4 2. What it Does ..................................................................................................................................... 4 What it Does Not Do ........................................................................................................................ 4 Setup for Testing ...
LCD2041 rev 2 3
1. Introduction Your LCD2041 has the following features: 20 column by 4 line text display built-in font with provision for up to 8 user-defined characters Speeds from 1200 bps to a lighting fast 19.
LCD2041 PC +5V power RS-232 Figure 1-1 Connections for Testing 1. Refer to the diagram above and Figure 2-1 for the following steps. 2. Wire the connector to the power supply. On most connectors the RED lead will go to +5V and the BLACK lead to GND. See Section 2.1.1 for details. Note: The manufacturer's warranty is void if the unit is subjected to over-voltage or reversed polarity. 3. Connect the LCD2041 to the PC using the serial cable and adapter if required.
If you want to exercise some of the other features of the LCD2041 you'll need to write a program (in any convenient language such as Basic or C) to issue the required command strings. Most terminal programs are unable to issue the 0xFE character needed as a command prefix. You probably won't need to do this at the initial testing stage. If you've reached this point and operation is normal, you can be confident that your LCD2041 works properly.
2. Connections and Configuration 2.1 Connector Pinout Refer to the diagram below for this chapter. Figure 2-1 Electrical Connections The LCD2041 has three connectors: Connector Function 2 pin header 4 pin DB-9F General purpose output (see section 0) power and I2C communications (see section 2.1.1) RS-232/power (see section 2.2.2) 2.1.1 Power and I2C Connections Power is applied via pins 1 and 4 as shown in Figure 2-1. Power requirement for standard units is +5 VDC ±0.
Connector pinout is as follows: 1 2 3 4 Figure 2-2 Power connector Pin 1 Pin 2 Pin 3 Pin 4 +5.0 VDC (+8 to +15 VDC with wide voltage option) SCL (I2C clock) SDA (I2C data) Ground 2.1.1.1 Five Volt Modules If the LCD2041 is used in a PC it is tempting to plug a spare power connector into the unit. Don't do this! Wiring for the PC power connector and that required for the LCD2041 are different as shown in Figure 2-3 below.
2.1.1.2 Wide Voltage Range Modules Note: Do not use this cable unless your display module has the "wide voltage range" option (option V). Use of the 12 volt power cable with 5 volt modules will damage the module. The 12 volt power cable is designed for use with wide voltage range display modules mounted in a PC. Wiring required for the 12 volt power connector is shown in Figure 2-5 below.
The RS-232 connector on the PC cable is wired so that a standard “straight through” 9 pin D-sub cable may be used to connect the module to a standard serial port such as COM ports on PCs. Note that this device complies with the EIA232 standard in that it uses signal levels from ± 3V to ± 12V. It will not operate correctly at TTL (0 to +5V) levels. Pin Number Direction Description LCD Host 2 Data from LCD Data out (LCD) Tx Rx 3 Data to LCD Data in (LCD) Rx Tx 5 - Ground gnd gnd 2.2.
The module is supplied with jumpers J1 and J2 installed, which gives an RS-232 baud rate of 19200 and an I2C address of 0x5C. RS-232 port: J0, J1, J2 - control baud rate.
The LCD2041 uses a standard Phillips 7bit address as defined by Phillips. How ever, we at Matrix Orbital specify I2C address in 8bits. The 8th bit, least significant bit (LSB or Low Order Bit) of the 8bit address is read/write bit. If we take a standard Phillips 7bit address of 45hex this would be in binary 1000101. This is 7bits. If one adds the read write bit to this 7bit address and you assume that you are writing one gets 10001010. Matrix Orbital would describe the Philips I2C address of 45hex as 8Ahex.
Jumper 240 ohm resistor GPO +- Figure 2-10 Bypassing 240 ohm resistor Note: The GPOs do not have any over current or over/under voltage protection so care must be taken when using them. For instance if the external device is a relay it must be fully clamped (using a diode and capacitor – see Figure 2-11) to absorb any generated back electro-motive force (EMF).
3. Displaying Text This chapter describes the various text-display commands in detail. A quick reference summary of all text commands is found in section 6.4. 3.1 General Text is displayed on the LCD2041 using the built-in 5 x 7 dot matrix font (plus up to 8 user-defined characters. 3.2 The Built-In Character Font The LCD2041 includes a built-in 5 x 7 dot matrix font with the full range of ASCII characters plus a variety of extended characters, as shown in Figure 3-1.
In addition to the built-in characters, users may define up to 8 special characters (which, once defined, occupy positions 0x00 to 0x07 in the above chart). The LCD2041 does not have provision to download other fonts. 3.3 Writing Text to the Display When the display receives a character, it displays that character at the position currently defined. The next character sent to the module then advances to the following position on the display.
3.4.7 Turn on underline cursor (254 74) Turns on the underline cursor. The cursor shows the current text insertion point. Both underline and blinking cursors may be turned on or off independently. The underline cursor is OFF by default. 3.4.8 Turn off underline cursor (254 75) Turns off the underline cursor. Does not affect the blinking block cursor. 3.4.9 Turn on block (blinking) cursor (254 83) Turns on the blinking block cursor. The cursor shows the current text insertion point.
4. Bar Graphs and Special Characters The LCD2041 includes the ability to draw bar graphs (either horizontal or vertical), large numbers, and allows users to define up to eight special characters. Before issuing commands to the LCD2041 please read sections 6.2 and 6.3. Eight characters (ASCII values 0x00 to 0x07) are set aside for use with bar graphs, user defined characters, and large digits. Since the same 8 characters are used for each function, the functions may not be used simultaneously.
4.1.7 Place large digit 254 35 [col] [digit] This command allows the large digits to be drawn on the LCD screen. Numbers of almost full display height may be placed along side regular text on four row displays. The column number has a maximum value which is less than the display width because the digits are all three columns wide. Before using this command the Initialize Large Digits command must be issued to define the blocks necessary to make up the digits.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Cursor Line Note: Custom characters will be erased if either the "initialize bar graph" or "initialize large digits" commands are issued.
5. Miscellaneous Commands The commands listed in this chapter don't readily fit in any of the other categories, or are used in more than one category. Before issuing commands to the LCD2041 please read sections 6.2 and 6.3. 5.1 Command List 5.1.1 Clear display (254 88) This command clears the display and resets the text insertion point to the top left of the screen. 5.1.
5.1.7 Read module type (This Command does not work on the LCD2041) This command will return, over the RS-232 interface, the model type value of the module. This command returns a 1-byte hex value.
6. Appendix: Command Summary 6.1 General The operation of the LCD2041 is controlled by a simple and consistent command set. Commands control text display graphics display miscellaneous operating parameters This chapter includes summary tables of all commands. Individual commands are discussed in detail in Chapters 3 and 4 in the same sequence as in the following tables. 6.2 Issuing Commands Commands are issued to the LCD2041 by the controller.
Based on the table, the byte 01001011 can be represented in hex as 4B, which is usually written as any of 4Bh, 4BH, 4B hex or 0x4B. The numbers can also be expressed in decimal form if preferred. 6.3.1 ASCII Characters Since computers deal internally with numbers only, but externally with both letters and numbers, several schemes were developed to "map" written characters to numeric values. One such scheme has become universal, the American Standard Code for Information Interchange, or ASCII.
Command Syntax Default Notes 254 74 254 'J' R Underline cursor off FE 4B 254 75 254 'K' R Turns off the underline cursor. Block cursor on FE 53 254 83 254 'S' on R Turns on the blinking block cursor. Block cursor off FE 54 254 84 254 'T' R Turns off the blinking block cursor. Cursor left FE 4C 254 76 254 'L' Moves the cursor one position to the left. If the cursor is already at the beginning of a line it will move to the end of the other line.
Initialize large digits FE 6E 254 110 254 'n' Initializes the user character set to make large digits. Place large digits FE 23 [col] [digit] 254 35 [col] [digit] 254 '#' [col] [digit] Place large digit number [digit] in column [col] of the display. Cursor moves to bottom right of large digit. [digit] is 0x00 to 0x09, [col] is 0x01 to 0x12 (i.e. 1 to 18 decimal). Define custom character FE 4E [c][8 bytes] 254 78 [c][8 bytes] 254 'N' [c][8 bytes] Defines one of 8 custom "user" characters.
6.6 Miscellaneous Commands Table 6-3 Miscellaneous Commands Command Syntax Default Notes Clear display FE 58 254 88 254 'X' n/a Clears screen of text and graphics, places text cursor at top left. Set contrast FE 50 [contrast] 254 80 [contrast] 254 'P' [contrast] 0x80 128 Sets display contrast. Compensates for viewing angle. Contrast is a value between 0 and 255 (hex 0 to FF). Larger = darker.
7. Appendix: Specifications and Options 7.1 Specifications 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 -40°C to +85°C Operating Relative Humidity 90% max non-condensing 90% max non-condensing Electrical Specifications Supply Voltage 4.75 - 5.
Figure 7-1 Physical Layout 7.
8. Appendix: Glossary ASCII American Standard Code for Information Interchange. A 7 bit binary code representing the english alphabet, decimal numbers and common punctuation marks. "Also includes control characters" such as carriage return or end of text. An 8 bit superset of the standard ASCII codes is often used today to include foreign characters and other symbols. These supersets are often called extended ASCII character sets.
LCD Liquid Crystal Display Module Type Value This refers to the model number of the module. Pixel The smallest individually controllable element of a display. Pre-Generated Fonts Pre-determined fonts which can be downloaded into graphic liquid crystal displays. Primitive A low-level object or operation from which higher-level, more complex objects and operations can be constructed.