PK202-25 Technical Manual Revision: 1.
Contents Contents ii 1 Introduction 1.1 What to Expect From the PK202-25 . . 1.2 What Not to Expect From the PK202-25 1.3 Keypad Interface . . . . . . . . . . . . 1.4 Setup for Testing . . . . . . . . . . . . 1.5 Trying Out the PK202-25 . . . . . . . . 1.6 Trying Out a Keypad . . . . . . . . . . 1.6.1 Here’s what to Do . . . . . . . 1.7 Manual Over-ride . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Keypad Interface 4.1 General . . . . . . . . . . . . . . . . . . . . . . . 4.2 Connections . . . . . . . . . . . . . . . . . . . . . 4.3 I2 C Interface . . . . . . . . . . . . . . . . . . . . 4.4 RS-232 Interface . . . . . . . . . . . . . . . . . . 4.5 Keypad Commands . . . . . . . . . . . . . . . . . 4.5.1 Auto repeat mode on (254 126 [mode]) (R) 4.5.2 Auto repeat mode off (254 96) (R) . . . . . 4.5.3 Auto transmit keypresses on (254 65) (R) . 4.5.4 Auto transmit keypresses off (254 79) (R) . 4.5.
7 1-Wire Commands 7.1 Device Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.3 ROM Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4 Display 1-Wire Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4.1 Transaction command (254 C8 1 [flags] [Send Bits] [Recieve bits] [Send data]) 7.4.
1 Introduction The PK202-25 comes equipped with the following features: • • • • • • • • • • • • • • • • 20 column by 2 line text PLED display Built in font with provision for up to 8 user defined characters Speeds from 1200 bps to a lighting fast 19.
1.3 Keypad Interface The keypad interface takes row / column input and converts it to ASCII characters, which are delivered out the RS-232 or I2 C port to the associated controller. Note that the keypad is not used to directly control any aspect of the operation of the display, which acts simply as a matrix to serial converter. To use the keypad to control the display, the controller must be programmed accordingly. 1.
4. Connect the power connector, making sure that the +5V goes to V+. Turn on the power: the display should come on. 1.5 Trying Out the PK202-25 The unit should be connected to power. The PC and display should be on. To experiment with typing text, run a PC terminal program, such as Hyperterm. Make sure it’s configured to use the correct port. Set the baud rate to 19,200. If characters are typed on the keyboard, they should now appear on the display screen.
2. With the display connected to the PC, plug in the keypad. If the connector has fewer pins than the one on the display, center it as well as possible. NOTES • The keypad connector must be wired with columns on one side and rows on the other side of the center of the connector. If the keypad isn’t wired this way an adapter must be made or the connector must be rewired to meet this requirement. • The connector is reversible.
1-Wire Connector Keypad Connector GPOs Configuration Jumpers Power/Data Connector DB9 Connector Figure 2: Electrical Connections The display has four connectors: Table 2: Connectors & Functions Connector 12 pin dual header 4 pin 12 pin header DB-9F Matrix Orbital Function General purpose outputs (6) Power (5.
2.1.1 Power Connections Power is applied via pin1 and ground via pin 4 as shown in the figure below. Power requirement is +5 VDC ±0.25V. As an alternate power conncetion, power may also be supplied via the RS-232 connector as described in section 2.1.4. WARNINGS • Do not apply any power with reversed polarization. • Do not apply any voltage other than the specified voltage. • Do not use any cables other than the cables supplied by Matrix Orbital, unless aware of the modifications required.
Figure 4: Wiring for 5V Modules Matrix Orbital can supply an adapter cable designed for use with the display when it’s installed in a PC. The cable is wired as shown in the Figure below. Note that this cable does not provide connections for I2 C. Figure 5: 5V 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 (option V). Use of the 12 volt power cable with 5 volt modules will damage the module.
Figure 6: Wiring for 12V Modules Matrix Orbital can supply an adapter cable designed for use with the display module when it’s installed in a PC. The cable is wired as shown in the Figure below. Figure 7: 12V Power Cable 2.2 Communication Connection 2.2.1 RS-232 Communications A standard DB-9F is provided for RS-232 communications. This unit is set to RS232 communication by factory default. WARNINGS • Do not apply any voltage other than the specified voltage.
Figure 8: RS-232 and Power Connector Figure 9: Power Applied via DB9 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. Please see the figure below for pinout configuration. NOTE 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 with out modification.
5 32 9 Figure 10: DB9 Pinout For RS232 communication via the 4 pin connector, please see the figure and table below. 1234 1234 Figure 11: Power Connector Table 5: Connector Pinout Pin 1 Pin 2 Pin 3 Pin 4 2.2.2 +5.0 VDC (+7 to +15 VDC with wide voltage option) Rx Tx Ground TTL Communications A standard DB-9F or 4 pin power connector/communication (female) connector is needed for TTL communications. Power may also be supplied via this connector if desired.
Figure 12: TTL Select Note that this device uses signal levels from 0V to + 5V on the TTL setting.
Table 7: Connector Pinout Pin 1 Pin 2 Pin 3 Pin 4 2.2.3 +5.0 VDC (+7 to +15 VDC with wide voltage option) Rx (receive data) Tx (transmit data) Ground I2 C Communications The display I2 C communications runs at 100 Kbps and supports up to 127 units on a single communications line. The I2 C data line operates on 5 volt CMOS levels. One modification is required for I2C. The RS232 jumper selection must be removed and placed on the I2C jumper selection.
Table 8: Connector Pinout Pin 1 Pin 2 Pin 3 Pin 4 2.2.4 +5.0 VDC (+7 to +15 VDC with wide voltage option) I2 C SCL (clock) I2 C SDA (data) Ground 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.
GND Data +5V Figure 16: 1-Wire Pinout 2.3 General Purpose Outputs The display has six general purpose outputs. These are provided to control relays or other electronic devices. This allows external devices to be turned on or off using the PC or controller and software commands. Each output is wired as shown in the Figure below. The + terminal is connected directly to the module positive supply, the - terminal is connected through a 240 ohm current limiting resistor and the electronic switch to ground.
Figure 18: 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 (EMF). Suggestions for clamping a relay: Figure 19: Clamping a Relay 3 Displaying Text This chapter describes the various text display commands in detail.
3.1 General Text is displayed on the PK202-25 using the built in 5x8 dot matrix font. In addition, there are up to 8 user defined characters. 3.2 The Built In Character Font The display includes a built in 5x8 dot matrix font with the full range of ASCII characters plus a variety of extended characters, as shown in the Figure below.
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 (i.e., the cursor is advanced for the next character).
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 and 2 (0x01 and 0x02). 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) (R) 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. NOTE This command moves the text insertion point even if the cursor is turned off. 4 Keypad Interface This chapter describes the keypad interface and associated commands in detail. 4.1 General The display keypad interface processes the keypad row / column matrix into a serial (RS-232 or I 2 C) data byte stream.
NOTE The keypads may be laid out in a different pattern. If this is the case, the user will need to interpret the key codes differently. Also included are two extra pins on each end of the connector to be used for ground strapping. This can be used in conjunction with your keypad if a ground strap connection is required or if a common ground connection is needed.
4.5 Keypad Commands Some commands, marked with an “R”, may be "Remembered" to set new defaults that will be in effect each time the unit is powered on. When “remeber” is set / turned on, these commands are automatically remembered to take effect each time the unit is powered on, therefore there is no need to send the save function. 4.5.1 Auto repeat mode on (254 126 [mode]) (R) [mode] = 0x00 gives Resend Key Code mode [mode] = 0x01 gives Key Down / Key Up Code mode 1.
4.5.3 Auto transmit keypresses on (254 65) (R) In this mode, all keypresses are sent immediately to the host system without the use of the poll keypad command. This is the default mode on power up. 4.5.4 Auto transmit keypresses off (254 79) (R) In this mode, up to 10 keypresses are buffered until the unit is polled by the host system via the poll keypad command. Issuing this command places the unit in polled mode. 4.5.5 Clear key buffer (254 69) This command clears any unread keypresses.
be defined or redefined at any time by issuing the commands shown in this section. Once defined, they may be used either by means of the bar graph commands, or by simply issuing one of the ASCII values 0x00 to 0x07 (which is not prefixed by the command byte, 254). 5.1 Command List 5.1.1 Initialize wide vertical bar graph (254 118) This command defines the 8 special / user characters to be blocks suitable for use in drawing wide (5 pixel) vertical bar graphs.
5.1.6 Define custom character (254 78 [c] [8 bytes]) The display allows up to 8 user defined (custom) characters. These characters occupy the first 8 (0x00 to 0x07) places in the character set. Custom characters occupy a 5x8 pixel matrix. Built in characters are 5x8. The characters are defined by issuing the command: 254 78 [c], followed by 8 bytes to define the character. [c] is the character number (0x00 to 0x07).
5.1.7 Initialize Medium Digits (254 109) This command defines the 8 special characters to be blocks suitable for use in drawing medium digits. Any previous definitions will be lost. Once this command has been issued, any number of medium characters may be placed until the characters are redefined by another command. 5.1.8 Draw Medium Digits (254 111 [row][column][digit]) Draws a medium digit in [row] and [column] using the specified [digit]. Medium digits occupy two rows.
6.1.3 Set brightness (254 89 [brightness]) (R) Brightness is set to 100% by default. his commands sets the display’s backlight brightness to [brightness], where [brightness] is a value between 0x00 and 0xFF (between 0 and 255). Lighting conditions will affect the actual value used for optimal viewing. Lower values will cause the intensity to “dim”, while higher values cause the intensity to “brighten”. 6.1.
Table 13: Default Screen Character 1 Character 21 Character 20 Character 40 If sending more than 10 characters to be stored, add in a ~10ms per character delay. Predefined custom characters can be used in the “Start up Screen” as well, by using 0x00 through 0x07 characters. 6.1.8 General purpose output off (254 86 [gpo #]) This command turns OFF any of the general purpose outputs. [gpo #] is 1 to 6. Note that OFF means that the output is high. 6.1.
Table 14: Module Values LCD0821 - 0x01 LCD4021 - 0x06 LK204-25 - 0x09 VFD2041 - 0x0C VK204-25 - 0x0F GLK24064-25 - 0x15 6.1.13 PK202-25 - 0x LCD4041 - 0x07 LK404-55 - 0x0A LK162-12 - 0x34 GLC12232 - 0x10 GLK12232-25 - 0x22 LCD2041 - 0x05 LK202-25 - 0x08 VFD2021 - 0x0B VK202-25-0x0E GLC24064 - 0x13 LK402-12 - 0x33 Set RS-232 port speed (254 57 [speed]) (R) This command sets the display’s RS-232 port to the specified [speed]. The change takes place immediately.
6.1.16 Read Version Number (254 54) This command will return the firmware version number of the display as a 1 byte hex value over RS-232 only. 6.2 Flow Control The display has built in flow control which may be useful when long strings of text are downloaded to the display. Flow control is enabled or disabled by two commands.
7.1 Device Identification Each 1-wire device contains a unique 64-bit address in which to identify them with. The address is guaranteed to be unique from any other device, allowing a virtually unlimited number of devices on to be attached to the bus. The address itself contains a family code and a cyclic redundancy check (CRC). The family code is unique to a particular device model. For example, the family code for the DS18S20 temperature probes is 10H.
• Read ROM [33h]: All devices will begin transmitting their address after this command. This command will only succeed when there is one device on the bus. When multiple devices are present, all devices will begin transmitting their addresses, overlapping each other. This command can be used to determine if there is more than one device on the bus. After the address has been read back, if the CRC is valid, there is only one device on the bus.
Table 17: 1-Wire Flags Bit 7 6 5 4 3 2 1 0 Description Unused (0 for future compatibility) Add a CRC8 to the end of the transmitted data (0 for future compatibility) Assume last received byte is a CRC8 and validate it Reset bus before transaction The received data is sent back using the “Display return protocol”. Table 18: 1-Wire Error Codes Code 0x00 0x01 0x02 0x03 7.4.
Table 19: Search Return Packet 8 Offset (Bytes) 0 2 Offset (Bytes) 2 1 3 4 5 13 1 1 8 1 Description 0x232A - Preamble 0x8A - Packet is 10 bytes long, another address will follow 0x0A Packet is 10 bytes long, this is the last address 0x31 - 1-Wire Packet Type Error Code (0x00 for success) 1-Wire Address CRC8 - 0x00 means the last address was valid Appendix: Command Summary 8.1 General The operation of the display is controlled by a simple and consistent command set.
G H 34* *1 %/%I J <- H 3 * * K L 1> ' " DACB G H 34* *1 %/%I J <- H 3 * * K L 1> OM NPMQACB 8.3 On Numbers Like all computerized devices, the display operates with commands and values in the form of binary numbers. These binary numbers are arranged in 8 digit (i.e., 8 bit) groups called bytes. The decimal value of a byte may have any value from 0 to 255.
Table 21: Example of an ASCII Table The letter The letter The number The number A A 0 9 has a value of has a value of has a value of has a value of 65 Decimal or 97 Decimal or 48 Decimal or 57 Decimal or 41 Hex 61 Hex 30 Hex 39 Hex 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 1 to 6.
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 R Notes Moves cursor to the specified column and row. The cursor marks the text insertion point in this and all commands. This command moves the cursor to the top left of the display area. Turns on the underline cursor.
8.
8.6 Bar Graphs and Special Characters The commands in this section are used to define and display bar graphs and special characters.
Command Draw medium digits Syntax FE 6F [r][c][digit] 254 111 [r][c][digit] 254 ’o’ [r][c][digit] Notes Draws a medium digit in [row] and [column] using the specified [digit]. Medium digits occupy two rows. When the [row] is specified to be “1”, the medium digit will be displayed correctly. When the [row] is specified to be “2”, only the top part of the medium digit will be displayed. When [row] is specified to be “0”, only the bottom part of the medium digit will be displayed. 8.
Command Remember Syntax FE 93 [0|1] 254 147 Default Off Set brightness and save FE 91 [brightness] 245 145 [brightness] 0xFF R Display on FE 42 [minutes] 254 66 [minutes] 254 ’B’ [minutes] On R Display off FE 46 254 70 254 ’F’ FE 40 [40 char] 254 64 [40 char] 254 ’@’ [40 char] Off R General purpose output off FE 56 [gpo #] 254 86 [gpo #] 254 ’V’ [gpo #] Off R General purpose output on FE 57 [gpo #] 254 87 [gpo #] 254 ’W’ [gpo #] Off R Remember general purpose output FE C3 [gpo#][gpo value
Command Remember Syntax FE 93 [0|1] 254 147 Default Off Read module type 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 FE 35 254 53 254 ’5’ FE 36 254 54 254 ’6’ N/A Enter flow control mode FE 3A [full] [empty] 254 58 [full] [empty] 254 ’:’ [full] [empty] Off R Exit flow control mode FE 3B 254 59 254 ’;’ Off R Set RS-232 port speed Set Serial Number Read Serial Number Read Version Number Matrix Orb
9 Appendix: Specifications and Options 9.1 Specifications Table 30: Environmental Specifications Operating Temperature Storage Temperature Operating Relative Humidity Vibration (non-operating) Vibration (operating) Shock (Non-operating) Shock (operating) Standard Temperature 0◦ C to +50◦C -30◦ C to +70◦ C 20 to 80% non condensing 19.6 M/s2 (Max) 4.9 M/s2 (Max) 30 minutes (Duration) X, Y, Z each direction 490 M/s2 29.4 M/s2 Extended Temperature -20◦C to +50◦C -30◦C to +70◦C 20 to 80% non condensing 19.
Figure 23: Physical Layout 9.
ASCII Backlight Binary Number Bit Bitmap Byte CCFL Configuration Contrast Controller DB-9 Firmware Font Font Metric 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.
Hexadecimal I2 C Interface LCD Module Type Value Pixel PLED Pre-Generated Fonts Primitive RS-232 Scroll Serial Number Serial Port Matrix Orbital Refers to the base-16 number system, which consists of 16 unique symbols: the numbers 0 to 9 and the letters A to F. For example, the decimal number 15 is represented as F in the hexadecimal numbering system. The hexadecimal system is useful because it can represent every byte (8 bits) as two consecutive hexadecimal digits.
Version Number Volatile Memory Matrix Orbital This refers to the firmware revision number of the module. Temporary memory. Once the power supply is turned off volatile memory is then erased.