LCD4041 Technical Manual Revision: 1.
Contents Contents ii 1 Introduction 1.1 What to Expect From the LCD4041 . . 1.2 What Not to Expect From the LCD4041 1.3 Setup for Testing . . . . . . . . . . . . 1.4 Trying Out the LCD4041 . . . . . . . . 1.5 Manual Over-ride . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.1.7 4.1.8 Initialize large digits (254 110) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Place large digit (254 35 [col] [digit]) . . . . . . . . . . . . . . . . . . . . . . . . . 16 5 Miscellaneous Commands 5.1 Command List . . . . . . . . . . . . . . . . . . . . . . 5.1.1 Clear display (254 88) . . . . . . . . . . . . . . 5.1.2 Set contrast (254 80 [contrast]) . . . . . . . . . . 5.1.3 Backlight on (254 66 [minutes]) . . . . . . . . . 5.1.4 Backlight off (254 70) . . . . . . . . . . .
1 Introduction The LCD4041 comes equipped with the following features; • • • • • • • • • • • • • 40 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.
• A 9 or 25 pin RS-232 serial cable. If using a 25 conductor cable, a 9 to 25 pin adapter will be required 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.
Table 1: Common ASCII Control Characters Character CR Hex Value 0x0D LF 0x0A FF 0x0C BS 0x08 Function Moves cursor to the beginning of the current line Moves cursor to the beginning of the next (or previous) line Clears the display and puts the cursor at the top left Moves cursor one position to the left and clears that position NOTE These command characters are not guaranteed to work on other Matrix Orbital display modules.
2 Connections 2.1 Connector Pinout Refer to the diagram below for this chapter. Figure 3: Electrical Connections The display has three connectors; Table 2: Connectors & Functions Connector 2 pin header 4 Pin DB-9F 2.1.1 Function General purpose output Power (Vdc) and I2 C communications RS-232 / Power Power and I2 C Connections Power is applied via pins 1 and 4 as shown in the Figure above. Power requirement is +5 VDC ±0.25V.
Connector pinout is as follows; Figure 4: Power Connector Table 3: Connector Pinout Pin 4 Pin 3 Pin 2 Pin 1 2.1.2 Ground SDA (I2 C data) SCL (I2 C clock) +5.0 VDC (+7 to +15 VDC with wide voltage option) Five Volt Modules If the display is used in a PC it becomes 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 as shown in the Figure below.
Figure 6: Five Volt Power Cable 2.1.3 Wide Voltage Range Modules NOTE This cable should not be used with a display module which 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 the Figure below.
2.1.4 Power through the DB-9 Connector The display can be powered by pin 9 on the DB-9 connector. If power is applied here, power cannot be applied to the other power connector. The input voltage for pin 9 can only be +5Vdc, even if the unit is wide voltage. WARNING Failure to follow these instructions will destroy the unit. Solder a jumper as shown in the below image to use the DB-9 connector for power . Figure 9: DB-9 Connector 2.1.
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 modules 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 +/-12V to +/- 12V. To use standard RS-232 no modifications are required. The display does not allow the use of TTL. Table 4: RS-232 Pinout Pin Number 2 3 4 2.1.
for this one needs to understand something about how a Matrix Orbital module processes data. Basically the reason why a Matrix Orbital module might fail to receive a byte correctly is that it was unable to process the byte previous before the failed byte was transmitted. Because the module cannot possibly know that it would be unable to store the byte before the next byte was received it cannot know to not ACK. The reason for this situation in deference to situations one might be familiar with (i.e.
Figure 13: Clamping a Relay 3 Displaying Text This chapter describes the various text display commands in detail. Before issuing commands to the LCD4041 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.
Figure 14: 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. The display 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 Text Commands In this section commands are identified by their names and decimal values. Hex and ASCII equivalents are given in the summary. 3.4.1 Auto scroll on (254 81) When auto scrolling is on, it causes the display to shift the entire display’s contents up to make room for a new line of text when the text reaches the scroll position (the bottom right character position). 3.4.2 Auto scroll off (254 82) When auto scrolling is disabled, text will wrap to the top left corner of the display area.
3.4.8 Turn off block (blinking) cursor (254 84) Turns off the blinking block cursor. Does not affect the underline cursor. 3.4.9 Cursor left (254 76) Moves the cursor one position to the left but does not erase any character that may be in that position. Please note that this command moves the text insertion point even if the cursor is turned off.
4.1.2 Initialize narrow vertical bar graph (154 115) This command defines the 8 special / user characters to be blocks suitable for use in drawing narrow (2 pixel) vertical bar graphs. Any previously existing definitions will be lost. Once this command has been issued, any number of vertical bar graphs may be drawn unless the characters are redefined by another command. 4.1.3 Draw vertical bar graph (254 61 [column] [height]) Draws a vertical bar graph in [column] having a height of [height] pixels.
Table 6: 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.
4.1.8 Place large digit (254 35 [col] [digit]) This command allows the large digits to be drawn on the display 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.
5.1.4 Backlight off (254 70) This command turns the backlight of the display off. 5.1.5 Load startup screen (254 64 [32 characters]) This command sets and memorizes the startup screen that will appear each time the display is turned on. By default the screen shows; Table 8: Default Screen Matrix Orbital LCD4041 The 160 characters define the four 40 character rows of the screen. They may be any characters from the Character Set.
The change in address is immediate. This address is 0x50 by default, and is reset temporarily back to that value when the ’manual over-ride’ jumper is used on power up. 5.1.9 Read module type (254 55) This command will return, over the RS-232 interface, the model type value of the module. This command will return a 1-byte hex value.
change and the module will return to the originally set serial number. 5.1.12 Read Serial Number (254 53) This command will return, over the RS-232 interface, the two-byte serial number of the module as it was previously stored. 5.1.13 Read Version Number (254 54) This command will return the firmware version number of the display. This command returns a 1-byte hex value. 5.
5.2.2 Exit Flow Control Mode (254 59) This command turns off flow control. Bytes may overflow the buffer without warning. 6 Appendix: Command Summary 6.1 General The operation of the display is controlled by a simple and consistent command set. Commands control; • Text display • Miscellaneous operating parameters 6.2 Issuing Commands Commands are issued to the display by the controller. In a test setup, commands can be issued to the display by means of a BASIC program, using the chr$( ) function.
Table 12: Hex Value Table Binary 0000 0001 0010 0011 0100 0101 0110 0111 Hex 0 1 2 3 4 5 6 7 Decimal 0 1 2 3 4 5 6 7 Binary 1000 1001 1010 1011 1100 1101 1110 1111 Hex 8 9 A B C D E F Decimal 8 9 10 11 12 13 14 15 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.
Table 14: Text Commands Command Auto scroll on Syntax FE 51 254 81 254 ’Q’ Default Off Auto scroll off FE 52 254 82 254 ’R’ Off Set cursor position FE 47 [col] [row] 254 71 [col] [row] 254 ’G’ [col] [row] N/A Send cursor home FE 48 254 72 254 ’H’ 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’ Underline cursor off Block cursor on Block cursor off Matrix Orbital Off Notes Enables scroll at bottom of screen.
Command Cursor left Syntax FE 4C 254 76 254 ’L’ Cursor right FE 4D 254 77 254 ’M’ Default Notes 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. Moves the cursor one position to the right. If the cursor is already at the end of a line it will move to the beginning of the other line. 6.5 Bar Graphs and Special Characters The commands in this section are used to define and display bar graphs and special characters.
Command Draw vertical bar graph Syntax FE 3D [col][length] 254 61 [col][length] 254 ’=’ [col][length] Draw horizontal bar graph FE 7C [c][r][d][length] 254 124 [c][r][d][length] 254 ’|’ [c][r][d][length] Initialize large digits FE 6E 254 110 254 ’n’ FE 23 [col] [digit] 254 35 [col] [digit] 254 ’#’ [col] [digit] Place large digits Notes Draws a vertical bar graph at column [col] of length [length]. Length is measured in pixels (0x00 to 0x14).
Command Backlight on Syntax FE 42 [minutes] 254 66 [minutes] 254 ’B’ [minutes] Default on Backlight off FE 46 254 70 254 ’F’ FE 40 [32 char] 254 64 [32 char] 254 ’@’ [32 char] on FE 56 254 86 254 ’V’ FE 57 254 87 254 ’W’ FE 33 [address] 254 51 [address] 254 ’3’ [address] off FE 37 254 55 254 ’7’ FE 39 [speed] 254 57 [speed] 254 ’9’ [speed] FE 34 [byte1][byte2] 254 52 [byte1][byte2] 254 ’4’ [byte1][byte2] see table Load startup screen General purpose output off General purpose output on Set I2 C a
7 Command Read Version Number Syntax FE 36 254 54 254 ’6’ Default Enter flow control mode FE 3A [full] [empty] 254 58 [full] [empty] 254 ’:’ [full] [empty] off Exit flow control mode FE 3B 254 59 254 ’;’ Notes Reads the firmware version number of the module. Returns a 1-byte value. Sets "full" and "empty" marks for the 80 byte display buffer. When buffer reaches [full] display will return 0xFE to host. When buffer reaches [empty] display will return 0xFF. Turns off flow control.
Table 22: Optical Specifications Number of Characters Matrix Format Display Area Character Size Character Pitch Line pitch Dot Size Dot Pitch LED Backlight Life Color of Illumination Matrix Orbital 160 (40 characters by 4 lines) 5 x 7 with underline 155.1 x 16.5 mm XxY 3.20 x 5.55 mm (XxY), not including underline 3.7 mm 5.95 mm 0.60 x 0.65 mm (XxY) 0.65 x 0.
Figure 15: Physical Layout 7.
8 Appendix: Glossary Table 24: Appendix: Glossary ASCII Backlight Binary Number Bit Bitmap Byte CCFL Configuration Contrast Controller DB-9 Firmware Matrix Orbital 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.
Font Font Metric Hexadecimal I2 C Interface LCD Module Type Value Pixel Pre-Generated Fonts Primitive RS-232 Scroll Serial Number Serial Port Version Number Matrix Orbital A design for a set of characters. A font is the combination of typeface and other qualities, such as size, pitch, and spacing. A definition of where font is to be placed, such as margins and spacing between characters and lines.
Volatile Memory Matrix Orbital Temporary memory. Once the power supply is turned off volatile memory is then erased.