LCD2041 Technical Manual Revision: 2.
Contents Contents ii 1 Introduction 1.1 What to Expect From the LCD2041 . . 1.2 What Not to Expect From the LCD2041 1.3 Setup for Testing . . . . . . . . . . . . 1.4 Trying out the LCD2041 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Connections 2.1 Connector Pinout . . . . . . . . . . . . . . . . . . . 2.1.1 Power Connection . . . . . . . . . . . . . . 2.1.2 Five Volt Modules . . . . . . . . . . . . . . 2.1.3 Wide Voltage Range Modules . . . . . . . . 2.1.
4 Bar Graphs and Special Characters 4.1 Command List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Initialize wide vertical bar graph (254 118) . . . . . . . . . . . . 4.1.2 Initialize narrow vertical bar graph (254 115) . . . . . . . . . . . 4.1.3 Draw vertical bar graph (254 61 [column] [height]) . . . . . . . . 4.1.4 Initialize horizontal bar graph (254 104) . . . . . . . . . . . . . . 4.1.5 Draw horizontal bar graph (254 124 [column] [row] [dir] [length]) 4.1.
1 Introduction The LCD2041 comes equipped with 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.
Figure 1: Connections for Testing 1. Refer to the Figure above 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. NOTE The Manufacturer’s Warranty becomes void if the unit is subjected to over-voltage or reversed polarity. 3. Connect the display to the PC using the serial cable and adapter if required. Make sure the RS-232 cable includes the required ground lead.
Figure 2: Electrical Connections The display has three connectors; Table 1: Connectors & Functions Connector 2 pin 4 pin DB-9F Function General purpose output Power and I2 C communication RS-232/power 2.1.1 Power Connection Power is applied via pins 1 and 4. Power requirement for standard units is +5 VDC ±0.25V . Units with the wide voltage range option require 8 - 15 VDC. WARNINGS • Do not apply any power with reversed polarization. Do not apply any voltage other than the specified voltage.
Connector pinout is as follows; Figure 3: Power Connector Table 2: Pinout Connections Pin 4 Pin 3 Pin 2 Pin 1 Ground SDA (I2 C data) / Rx SCL (I2 C clock) / Tx Vdc 2.1.2 Five Volt Modules If the display 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 display are different.
Figure 5: Five Volt Power Cable 2.1.3 Wide Voltage Range Modules NOTE Do not use this cable unless the display module has the "Wide voltage range" option. 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 the Figure below.
2.1.4 Applying Power through the DB-9 Connector Power may be provided to the module by pin 9 of the DB-9 connector instead of through the 4-pin SIP. If power is to be applied using the DB-9, it must be a regulated 5Vdc supply. NOTE This applies to wide voltage units, V and VPT extensions, as well as to standard 5 volt units. Figure 8: DB-9 Power To use pin 9 as the power source, the user must solder the 5 volt jumper pad beside the DB-9 connector. WARNING Application of a voltage to pin 9 greater than 5.
Figure 9: RS-232 and Power Connector Table 3: RS-232 Pinout Pin Number 2 3 5 Direction Data from LCD Data to LCD - Description Data out (LCD Data in (LCD) Ground LCD Tx Rx gnd Host Rx Tx gnd 2.2.2 Alternate Serial Connection An optional alternate connection header is provided to allow one cable for data and power. Two jumpers will have to be set into the RS-232 position above the DB-9 connector.
Pin 4 Pin 3 Pin 2 Pin 1 Ground Rx Tx Vdc Figure 11: Power Connector 2.2.3 TTL communications The display can be talked to at TTL (logic 0V to +5V) levels. The following three jumps will need to be modified as shown in figure below. This will allow TTL communications through the 4-pin SIP header or the DB9 connector. Figure 12: TTL Communications 2.2.4 Configuring RS-232 and I2 C RS-232 baud rate and I2 C address are configured by means of jumpers.
Figure 13: RS-232 Jumpers The module is supplied with jumpers J1 and J2 installed, which gives an RS-232 baud rate of 19200 and an I2 C address of 0x5C. • RS-232 port: J0, J1, J2 - control baud rate.
2.3 I2 C Communications I2 C I2 C communications runs at 100Kbps and supports up to 16 units on a single communications line. The data line operates on 5 volt CMOS levels. 2.3.1 ACK The idea of ACK is to indicate when the data has been received correctly. ACK does not indicate data incorrectly received. ACK simply fails to indicate when data is correctly received. Clearly, this is of limited usefulness and even less so with Matrix Orbital modules.
Pin 4 Pin 3 Pin 2 Pin 1 Ground SDA (12 C Data) SLC (I2 C Clock) Vdc Figure 15: Power Connector 2.4 General Purpose Output The display has a general purpose output which can be used to control relays or other electronic devices. This allows external devices to be turned on or off using your PC or controller and software commands. The + terminal is connected to the module positive supply, the - terminal is connected through a 240ohm current limiting resistor and the electronic switch to ground.
Figure 17: 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 to absorb any generated back electro-motive force or “EMF”. Figure 18: Clamping a Relay 3 Displaying Text This chapter describes the various text-display commands in detail. Before issuing commands to the LCD2041 please read sections 6.2 and 6.3.
3.1 General Text is displayed on the display using the built in 5x7 dot matrix font, in addition to up to 8 user defined characters. 3.2 The built in Character Font The display includes a built in 5x7 dot matrix font with the full range of ASCII characters plus a variety of extended characters, as shown in the Figure below. Figure 19: Character Set 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.
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. Characters are drawn using the built in font, and only characters defined in the font are actually displayed. Characters that are not defined by the built in font print as a space.
3.4.5 Set cursor position (254 71 [column] [row]) This command sets the cursor position (text insertion point) to the [column] and [row] specified. Columns have values from 1 to 20 (0x01 to 0x14) and rows have values of 1 to 4 (0x01 to 0x04). 3.4.6 Send cursor home (254 72) This command moves the cursor position (text insertion point) to the top left of the display area. 3.4.7 Turn on underline cursor (254 74) Turns on the underline cursor. The cursor shows the current text insertion point.
3.4.12 Cursor right (254 77) Moves the cursor one position to the right but does not erase any character that may be in that position. This command moves the text insertion point even if the cursor is turned off. 4 Bar Graphs and Special Characters The display includes the ability to draw bar graphs, either horizontally or vertically, large numbers, and allows users to define up to eight special characters.
4.1.4 Initialize horizontal bar graph (254 104) This command defines the 8 special / user characters to be blocks suitable for use in drawing horizontal bar graphs. Any previously existing definitions will be lost. Once this command has been issued, any number of horizontal bar graphs may be drawn unless the characters are redefined by another command. 4.1.
Table 5: 8 Byte Map * * * * * * * * * * * * * * * * * * * * * * * * 1 6 11 16 21 26 31 36 MSB LSB 2 3 4 7 8 9 12 13 14 17 18 19 22 23 24 27 28 29 32 33 34 37 38 39 5 10 15 20 25 30 35 40 Data Byte 1 Data Byte 2 Data Byte 3 Data Byte 4 Data Byte 5 Data Byte 6 Data Byte 7 Data Byte 8 A "1" bit indicates an on (black) pixel, a "0" bit indicates an off (clear) pixel. Once defined, a character is displayed simply by issuing a value (0x00 to 0x07) corresponding to the character number.
txUart.sendByte(0); txUart.sendByte(0x00); //display custom character 0 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. 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.6 Set backlight brightness (254 153 [brightness]) This command sets the display’s brightness to [brightness], where [brightness] is a value between 0x00 and 0xFF (between 0 and 255). The higher the number is, the brighter the backlight will appear. 5.1.7 General purpose output on (254 87) This command turns ON the general purpose output. ON means that the output is pulled low or, ground via 240ohms. 5.1.
commands in hex, ASCII and decimal form. All commands begin with the prefix character 0xFE (254 decimal). These commands are issued on the serial communications link (I2 C or RS-232) at the currently defined baud rate. For example (using BASIC in a test setup), the user could issue the command to clear the screen on the display by including the line: PRINT#1,chr$(254);chr$(88) in the BASIC program. ZComm1->WriteCommByte(0xfe); ZComm1->WriteCommByte(’X’); 6.
Table 9: Example of an ASCII Table Letter/ Number A a 0 9 Decimal Value 65 97 48 57 Hex Value 41 61 30 39 This gives rise to the possibility of confusion when parameters are being set on the display. For example, the GPO ON and OFF commands use a number to indicate which GPO is being controlled. We’re told that acceptable values are 0 to 8. All such parameters must use numeric values (i.e., the actual byte values).
Command Set cursor position Syntax FE 47 [col][row] 254 71 [col][row] 254 ’G’ [col][row] Default n/a Send cursor home FE 48 254 72 254 ’H’ n/a Underline cursor on FE 4A 254 74 254 ’J’ FE 4B 254 75 254 ’K’ FE 53 254 83 254 ’S’ FE 54 254 84 254 ’T’ FE 4C 254 76 254 ’L’ off FE 4D 254 77 254 ’M’ n/a Underline cursor off Block cursor on Block cursor off Cursor left Cursor right Matrix Orbital Notes Moves cursor to the specified column and row.
6.5 Bar Graphs and Special Characters The commands in this section are used to define and display bar graphs and special characters.
6.
7 Appendix: Specifications 7.1 Specifications Table 16: Environmental Specifications Operating Temperature Storage Temperature Operating Relative Humidity Standard Temperature 0◦ C to +50◦ C -20◦ C to +70◦ C 90% max non-condensing Extended Temperature -20◦ C to +70◦ C -40◦ C to +85◦ C 90% max non-condensing Table 17: Electrical Specifications Supply Voltage Supply Current Supply Backlight Current 4.75 - 5.
Matrix Orbital LCD2041 Figure 20: Physical Layout 27
7.2 Options Table 19: Options Available on LCD2041 Inverse Blue LCD WB Inverse Yellow LCD White backlight with Gray glass (Ice Blue) Extended Temperature Wide Voltage Wide Voltage with Efficient Switching Power Supply WB IY GW E V -VPT 8 Appendix: Glossary Table 20: Appendix: Glossary ASCII Backlight Baud Rate Binary Number Bit Bitmap Byte CCFL Matrix Orbital American Standard Code for Information Interchange.
Configuration Contrast Controller DB-9 Firmware Font Font Metric Hexadecimal I2 C Interface LCD Module Type Value Pixel Pre-Generated Fonts Matrix Orbital The way a system is set up, or the assortment of components that make up the system. Configuration can refer to either hardware or software, or the combination of both. The ratio of luminance between the light state of the display to the dark state of the display.
Primitive RS-232 Scroll Serial Number Serial Port Version Number Volatile Memory Matrix Orbital A low-level object or operation from which higherlevel, more complex objects and operations can be constructed. In graphics, primitives are basic elements, such as lines, curves, and polygons, which you can combine to create more complex graphical images Short for recommended standard-232C, a standard interface approved by the Electronic Industries Association (EIA) for connecting serial devices.