Matrix Orbital VK202-25 User manual

VK202-25 rev. 05 2
Table of Contents
1. Introduction.............................................................................................................................. 4
1.1 What it Does..................................................................................................................................... 4
1.2 What it Does Not Do ........................................................................................................................ 4
1.3 Keypad Interface............................................................................................................................... 4
1.4 Setup for Testing .............................................................................................................................. 4
1.5 Trying Out your VK202-25 .............................................................................................................. 5
1.6 Trying out a Keypad ......................................................................................................................... 6
1.6.1 Here's what to do: ................................................................................................................... 6
1.7 To Reset the module ........................................................................ Error! Bookmark not defined.
2. Connections............................................................................................................................. 8
2.1 Connector Pinout .............................................................................................................................. 8
2.1.1 Power and I2C Connections .................................................................................................... 8
2.1.2 RS-232 Communications...................................................................................................... 10
2.2 General Purpose Outputs ................................................................................................................ 11
3. Displaying Text ...................................................................................................................... 14
3.1 General ........................................................................................................................................... 14
3.2 The Built-In Character Font............................................................................................................ 14
3.3 Writing Text to the Display ............................................................................................................ 15
3.4 Text Commands.............................................................................................................................. 15
3.4.1 Auto line wrap on (254 67) .................................................................................................. 15
3.4.2 Auto line wrap off (254 68) ................................................................................................. 15
3.4.3 Auto scroll on (254 81) ........................................................................................................ 15
3.4.4 Auto scroll off (254 82) ....................................................................................................... 15
3.4.5 Set cursor position (254 71 [column] [row]) ........................................................................ 15
3.4.6 Send cursor home (254 72)................................................................................................... 15
3.4.7 Turn on underline cursor (254 74) ....................................................................................... 15
3.4.8 Turn off underline cursor (254 75) ...................................................................................... 16
3.4.9 Turn on block (blinking) cursor (254 83) ............................................................................ 16
3.4.10 Turn off block (blinking) cursor (254 84) ....................................................................... 16
3.4.11 Cursor left (254 76).......................................................................................................... 16
3.4.12 Cursor right (254 77)........................................................................................................ 16
4. Keypad Interface.................................................................................................................... 17
4.1 General ........................................................................................................................................... 17
4.2 Connections .................................................................................................................................... 17
4.3 I2C Interface.................................................................................................................................... 18
4.4 RS-232 Interface............................................................................................................................. 18
4.5 Keypad Commands......................................................................................................................... 18
4.5.1 Auto repeat mode on (254 126 [mode] ................................................................................ 18
4.5.2 Auto repeat mode off (254 96) (R) ....................................................................................... 19
4.5.3 Auto transmit keypresses on (254 65)................................................................................... 19
4.5.4 Auto transmit keypresses off (254 79) ................................................................................. 19
4.5.5 Clear key buffer (254 69) ..................................................................................................... 19
4.5.6 Poll keypad (254 38) ............................................................................................................ 19
4.5.7 Set debounce time (254 85 [time]) ...................................................................................... 19
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 3
5. Bar Graphs and Special Characters .................................................................................... 20
5.1 Command List ................................................................................................................................ 20
5.1.1 Initialize wide vertical bar graph (254 118).......................................................................... 20
5.1.2 Initialize narrow vertical bar graph (154 115) ...................................................................... 20
5.1.3 Draw vertical bar graph (254 61 [column] [height])............................................................. 20
5.1.4 Initialize horizontal bar graph (254 104).............................................................................. 20
5.1.5 Draw horizontal bar graph (254 124 [column] [row] [dir] [length])..................................... 20
5.1.6 Define custom character (254 78 [c] [8 bytes]) .................................................................... 20
6. Miscellaneous Commands ................................................................................................... 22
6.1 Command List ................................................................................................................................ 22
6.1.2 Clear display (254 88) .......................................................................................................... 22
6.1.3 Set brightness (254 89 [brightness]) ..................................................................................... 22
6.1.5 Backlight off (254 70) ......................................................................................................... 22
6.1.6 Load startup screen (254 64 [40 characters])........................................................................ 22
6.1.7 General purpose output off (254 86 [gpo #])........................................................................ 23
6.1.8 General purpose output on (254 87 [gpo #]) ........................................................................ 23
6.1.9 Set I2C address 254 51 [address])......................................................................................... 23
6.1.10 Read module type (254 55) .............................................................................................. 24
6.1.11 Set RS232 port speed (254 57 [speed])............................................................................ 24
6.1.12 Set Serial Number (254 52 [byte1] [byte2] ...................................................................... 24
6.1.13 Read Serial Number (254 53)........................................................................................... 24
6.1.14 Read Version Number 254 54)......................................................................................... 25
6.2 Flow Control................................................................................................................................... 25
6.2.1 Enter Flow Control Mode (254 58 [full][empty])................................................................. 25
6.2.2 Exit Flow Control Mode (254 59) ........................................................................................ 25
7. Appendix: Command Summary ........................................................................................... 26
7.1 General ........................................................................................................................................... 26
7.2 Issuing Commands.......................................................................................................................... 26
7.3 On Numbers.................................................................................................................................... 26
7.3.1 ASCII Characters.................................................................................................................. 27
7.4 Text Commands.............................................................................................................................. 27
7.5 Keypad Interface Commands.......................................................................................................... 28
7.6 Bar Graphs and Special Characters ................................................................................................ 29
7.7 Miscellaneous Commands .............................................................................................................. 30
8. Appendix: Specifications and Options................................................................................ 32
8.1 Specifications.................................................................................................................................. 32
8.2 Options ........................................................................................................................................... 33
9. Appendix: Glossary............................................................................................................... 34
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 4
1. Introduction
Your VK202-25 has the following features:
20 column by 2 line text fluorescent display
built-in font with provision for up to 8 user-defined characters
Speeds from 1200 bps to a lighting fast 19.2 Kbps over RS232
Communicate over I2C or RS232 (with software controlled speed)
Use up to 127 modules on the same 2-wire I2C interface
Fully buffered so that no delays in transmission are ever necessary
Add your own Splash/Start-up screen
Software controlled brightness with configurable display time-out setting up to 180 minutes
Use up to a 25 key keypad with a 10 key buffer.
Six general purpose outputs for a variety of applications
Horizontal or Vertical bar graphs
Variable power options, +5V or +9V to +15V
Extended temperature option.
Fits our PC Bay inserts without any modifications
1.1 What it Does
The VK202-25 is designed as the display unit for an associated controller. The controller may be anything
from a single board, special purpose microcontroller to a PC, depending on the application. This controller
is responsible for what you see on the screen of the VK202-25.
The VK202-25 provides a simple command structure to allow text and bar graphs to be displayed on the
screen. Text fonts are built in, and use standard ASCII mapping. Provision is made for up to 8 user-defined
characters.
The screen is luminous for low-light situations. Display may be turned on or off under program control.
Brightness is adjustable to compensate for differing lighting conditions.
General purpose outputs allow the controller to switch up to six electronic or electro-mechanical devices by
issuing commands to the display unit. These can be used for controlling LEDs, relays, etc.
1.2 What it Does Not Do
The VK202-25 does not include bitmap graphics capability, except that permitted by defining special
characters.
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 I2C port to the associated controller. Note that the keypad is not used to directly control any
aspect of the operation of the VK202-25, which acts simply as a matrix to serial converter. If you want to
use the keypad to control the VK202-25 display you must program your controller accordingly.
1.4 Setup for Testing
Before setting up your application you may want to try out the VK202-25. This is easily done with a PC.
Here's what you'll need:
A power cable with a 4 pin connector (same connector as used to connect 3.5 inch floppy
drive). Do not connect the VK202-25 to an unmodified spare power connector in a PC. To
modify such a cable see section 2.1.1.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 5
A 5 V power supply.
a PC with a spare RS-232 port (COM1 or COM2).
A 9 or 25 pin RS-232 serial cable. If you use a 25 conductor cable you'll also need a 9 to 25
pin adapter.
+5V power
VK202-25
PC
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 VK202-25 to the PC using the serial cable and adapter if required. Make sure the RS-232
cable includes the required ground lead. There must be no voltage differential between the RS-
232 ground and the power supply ground.
4. Connect the power connector, making sure that the +5V goes to V+ as shown in Figure 2-2. Turn on the
power: the display should come on.
Now you're ready to try it out.
1.5 Trying Out your VK202-25
The unit is connected to power and the PC and the display is on. You're ready to make sure it's working
properly.
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 you type characters on the keyboard, they should now appear on the VK202-25 screen. Text will wrap
around to the next line when you reach the end of a line. A few common ASCII control characters work as
follows:
Character Hex value Function
CR 0x0D Moves cursor to beginning of the current line.
LF 0x0A Moves cursor to the beginning of the next (or previous) line.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 6
FF 0x0C Clears the display and puts the cursor at the top left
BS 0x08 Moves the 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. If you want your code to be portable, use the appropriate commands listed later in the
manual instead.
If you want to exercise some of the other features of the VK202-25 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 VK202-25 works
properly.
1.6 Trying out a Keypad
Since a number of different keypad types can be connected to the VK202-25, the results you get may be a
little unpredictable. At this point all we need to do is make sure that your keypad and interface work, and
possibly generate an ASCII map for your programming needs.
The keypad interface on the VK202-25 converts a row/column connection to an ASCII character. By
default, a keypress is transmitted as serial data immediately. Keypad buffering can be selected using the
appropriate commands.
1.6.1 Here's what to do:
1. Your PC should be running a terminal program, such as Hyperterm (as in the previous section).
2. With the VK202-25 connected to the PC, plug in your keypad. If your connector has fewer pins than
the one on the VK202-25, center it as well as possible.
Note 1: The keypad connector must be wired with columns on one side and rows on the other side of
the center of the connector. If your keypad isn't wired this way you will need to make an adapter or
rewire the connector to meet this requirement.
Note 2: The connector is reversible. Reversing the connector will not damage the keypad or the
VK202-25, but it will change the ASCII character map.
3. Press a key on the keypad. An upper case ASCII character (A-Y) should appear on the PC screen.
Different keys should generate different characters.
If you want to experiment, reverse the connector and see if it generates a more logical set of characters.
Ultimately, the program in your controller will have to "map" these characters to the ones marked on the
keypad, which will likely be different.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 7
1.7 Manual Override
Manual override should only be required in one instance. If for some reason the module is set at a baud rate
which cannot be produced by the host system and all communication to the display is lost, then the user
should follow this simple procedure:
1. Turn off the display
2. Put a jumper on pins 5 and 6 of the keypad connector (C5 and R1).
3. Power up the display. The baud rate is now set to 19,200.
4. Remove the jumper and change the RS-232 port settings to the desired baud rate.
5. Turn off the display.
6. Power up the display.
Refer to the “Set RS-232 Port Speed” command (section 6.1.10) for acceptable baud rates.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 8
2. Connections
2.1 Connector Pinout
Refer to the diagram below for this chapter.
Key pad
Connector
Pow e r
connector
General
Purpose
Outputs
RS-232
pin 1
+5 gnd
pin 1
pin 5
1
2
3
4
5
6
Figure 2-1 Electrical Connections
The VK202-25 has four connectors:
Connector Function
14 pin dual header General purpose outputs (6) (see section 2.2)
4 pin power (5.0 VDC) and I2C communications (see section 2.1.1)
10 pin header Keypad (see section 3.4.12)
DB-9F RS-232/power (see section 2.1.1.1)
2.1.1 Power and I2C Connections
Power is applied via pins 1 and 4 as shown in Figure 2-1. Power requirement is +5 VDC ±0.25V. Power
may also be supplied via the RS-232 connector as described in the next section.
Warning:
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 you are aware of the modifications required.
Do not apply voltage to the DB-9 connector AND power connector
Do not apply more than +5Vdc to pin #9 on the DB-9 connector.
Connector pinout is as follows:
1 2 3 4
Figure 2-2 Power connector
Pin 1 +5.0 VDC (+7 to +15 VDC with wide voltage option)
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 9
Pin 2 SCL (I2C clock)
Pin 3 SDA (I2C data)
Pin 4 Ground
2.1.1.1 Five Volt Modules
If the VK202-25 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 VK202-25 are different as shown in Figure 2-3
below.
Figure 2-3 Power Connector wiring differences
If you don't want to modify cable wiring yourself, Matrix Orbital can supply an adapter cable designed to
use with the VK202-25 when it's installed in a PC. The cable is wired as shown in Figure 2-4 below. Note
that this connector does not provide connections for I2C.
Figure 2-4 Power Adapter Cable
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.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 10
PC wiring
Display module wiring
+5 V
+12 V
GND
GND
+12 V
Figure 2-5 Wiring for 12 volt modules
If you don't want to modify cable wiring yourself, Matrix Orbital can supply an adapter cable designed to
use with the display module when it's installed in a PC. The cable is wired as shown in Figure 2-6 below.
Figure 2-6 Twelve volt power cable
2.1.2 RS-232 Communications
A standard DB-9F is provided for RS-232 communications. Power may also be supplied via this connector
if desired. See Figure 2-7 for pin connections.
Figure 2-7 RS-232 and power connector
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 with out modification.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 11
Pin Number Direction Description LCD Host
2 Data from LCD Data Out Tx Rx
3 Data to LCD Data In Rx Tx
5 - Ground gnd gnd
The power connector on the PC cable is wired as shown in Figure 2-7.
2.1.3 I²C Communications
I²C communications runs at 100 kBps and supports up to 127 units on a single communications line. The
I2C data line operates on 5 volt CMOS levels.
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. Matrix orbital modules are not capable of failing
to acknowledge an incorrectly received byte in response to that bytes transition. They are only capable of
failing to acknowledge the bytes following the byte, which was not received. To fully understand the
reasons 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 you might be familiar with (i.e. memory chips, etc…)
is that the Matrix Orbital module employs a microprocessor to perform these data storage functions. A
memory chip takes care of these things entirely with in hardware subsystems that operate at the same speed
as the transmission themselves.
The VK202-25 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. The read address
would be 8Bhex.
For more information on Phillips I2C please visit…
http://www.ping.be/~ping0751/i2cfaq/i2cindex.htm
2.2 General Purpose Outputs
The VK202-25 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 your PC or controller and software
commands. (See sections 6.1.6 and 6.1.7 for the command syntax.)
Each output is wired as shown in Figure 2-8. 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.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 12
+ 5 V DC
240 ohm current limiting resistor
load
+
-
+
-
GPO 1
GPO 2
GPO 3
GPO 4
GPO 5
GPO 6
Power
Figure 2-8 General Purpose Outputs
Maximum allowable current is 20 mA, which is enforced by the current limiting resistor. If the device being
switched has a resistance of 240 ohms or more the corresponding resistor may be shorted. Solder a small
jumper wire (wirewrap wire is good) from the feedthrough hole to the corresponding negative pin for the
GPO in question.
Jumper wire
Figure 2-9 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).
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 14
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 7.4.
3.1 General
Text is displayed on the VK202-25 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 VK202-25 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.
Figure 3-1 Character Set
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 15
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 VK202-25 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. 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).
The position where text is to be inserted is a character location stored in the VK202-25's volatile memory
and maintained internally by the VK202-25's firmware. This position is manipulated by the commands
shown in the following section.
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 (Table 7-1). Before issuing commands to the VK202-25 please read sections 7.2
and 7.3.
3.4.1 Auto line wrap on (254 67)
Enables automatic line wrapping. Note that this is not "word wrapping" and wraps may occur in the middle
of a word.
3.4.2 Auto line wrap off (254 68)
Disables automatic line wrapping. Characters beyond the end of a line will be lost.
3.4.3 Auto scroll on (254 81)
When auto scrolling is on, it causes the VK202-25 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.4 Auto scroll off (254 82)
When auto scrolling is disabled, text will wrap to the top left corner of the display area. Existing text in the
display area is not erased before new text is placed. A series of "spaces" followed by a Cursor Home
command may be used to erase the top line of text.
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)
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 cursor is off by default.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 16
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. Both blinking and
underline cursors may be turned on or off independently. The cursor is off by default.
3.4.10 Turn off block (blinking) cursor (254 84)
Turns off the blinking block cursor. Does not affect the underline cursor.
3.4.11 Cursor left (254 76)
Moves the cursor one position to the left but does not erase any character that may be in that position. Note
that this command moves the text insertion point even if the cursor is turned off.
Note: A "destructive backspace", which erases the character to the left of the original position, may be done
by issuing the following sequence: cursor left, space, cursor left.
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 that this command moves the text insertion point even if the cursor is turned off.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 17
4. Keypad Interface
This chapter describes the keypad interface and associated commands in detail.
4.1 General
The VK202-25 keypad interface processes the keypad row/column matrix into a serial (RS-232 or I2C) data
byte stream. Aside from this processing, the keypad has no effect on the VK202-25 display. If you need to
send keystrokes to the display, they must be routed through your controller.
4.2 Connections
Figure 4-1 Keypad Connector
The connector is not "keyed" so your keypad will probably plug in either of two ways. The VK202-25 will
not be damaged by reversing the connector, but your keypad will generate a different ASCII character
mapping for each position. If your connector has fewer than 10 pins it should be centered on the VK202-25
connector.
The returned key codes are as follows, but note that your keypad may be laid out in a different pattern. If
this is the case, you will need to interpret the key codes differently. The diagram 1 shows the logical layout
(row 1, column 1 in upper left). The connector for the keypad is a 10 pin 0.1" spacing male header. Pin 1 is
indicated in Figure 2-1. Pins 1 through 5 are columns and pins 6 through 10 are rows. The keypad is
scanned whenever a key is pressed: there is no continuous key scan. This means that key presses are dealt
with immediately without any appreciable latency. This also prevents electrical noise which is often caused
by continuous key scans.
Columns
1 2 3 4 5
1 A B C D E
2 F G H I J
3 K L M N O
4 P Q R S T
Rows
5 U V W X Y
Note: The keypad connector must be wired with columns on one side and rows on the other side of the
center of the connector. If your keypad isn't wired this way you will need to make an adapter or rewire the
connector to meet this requirement.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 18
4.3 I2C Interface
The keypad is read by I²C master read. In short, this means that a read of the module will always return the
first unread key press. A read is initiated by writing to the module with its base address plus 1, then
clocking the module’s return byte after the module releases the SDA line. Much more detail on this basic
I²C function can be found in the I²C specification by Philips. A good reference is also available at
http://www.ping.be/~ping0751/i2cfaq/i2cindex.htm
The module contains a ten key press buffer so that it can be polled for key presses at an infrequent rate
(every 500 to 1000 mS is typical). All returned key presses indicate the presence or absence of additional
logged key presses by the most significant bit (MSB - bit 7). If the user has pressed two keys since the last
poll of the keypad interface, the first read will return the key code with bit 7 set and the second read will
return the key code with bit 7 clear. The application must take into account this bit to keep up with user key
presses. If there are no keypresses detected, the module will return zero (0x00).
4.4 RS-232 Interface
By default on any press of a key, the module will immediately send out the key code at the selected baud
rate. This behavior can be modified using commands found in the next section.
4.5 Keypad Commands
Before issuing commands to the VK202-25 please read sections 7.2 and 7.3.
4.5.1 Auto repeat mode on (254 126 [mode])
[mode] = 0x00 gives Resend Key Code mode
[mode] = 0x01 gives Key down / Key up code mode
Two Modes of auto repeat are available and are set via the same command.
1. Resend Key Code: This mode is similar to the action of a keyboard on a PC. In this mode, when a key
is held down, the key code is transmitted immediately followed by a 1/2 second delay. After this delay,
key codes will be sent via the RS - 232 interface at a rate of about 5 codes per second. This mode has
no effect if polling or if using the I²C interface.
2. Key down / Key up codes: This mode may be used when the typematic parameters of the Resend Key
code mode are unacceptable or if the unit is being operated in polled mode. The host system detects the
press of a key and simulates an auto repeat inside the host system until the key release is detected.
In this mode, when a key is held down, the key code is transmitted immediately and no other codes will
be sent until the key is released. On the release of the key, the key release code transmitted will be a
value equal to the key down code plus 20 hex. For example, the key code associated with key 'P' (0x50)
is pressed, the release code is 'p' (0x70).
In RS-232 polled mode (see 4.5.4 below) or via the I²C interface, the key down / key up codes are
used; however, the user should be careful of timing details. If the poll rate is slower than the simulated
auto – repeat it is possible that polling for a key up code will be delayed long enough for an unwanted
key repeat to be generated (see Figure 4-2).
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 19
unwanted auto-repeat
after key-up.
Polls
Key dow n
Key up
auto-repeat clock
valid key stroke
(before key up)
Figure 4-2 Poll timing
4.5.2 Auto repeat mode off (254 96)
This command turns off auto repeat mode.
4.5.3 Auto transmit keypresses on (254 65)
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)
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. In a menuing application, if the user presses a key which
changes the menu context, any following key presses may be inaccurate and can be cleared out of the buffer
between menu changes to prevent jumping around the menu tree. It may also be used to, in effect, reset the
keypad in case the host application resets for whatever reason.
4.5.6 Poll keypad (254 38)
This command returns any unbuffered keypresses via the RS - 232 interface. The host system must be set up
to receive the key codes. When the VK202-25 receives this command it will immediately return any
unbuffered keypresses which may have not been read already. If there is more than one keypress buffered,
then the high order bit (MSB) of this returned keycode will be set (1). If this is the only buffered keypress,
then the MSB will be reset (0). If there are no buffered keypresses, then the returned code will be 0x00.
Please note to make use of this command the “Auto Transmit Keypress” mode should be off.
4.5.7 Set debounce time (254 85 [time])
[time] is in increments of 6.554 milliseconds.
This command sets the time between key press and key read. All key types with the exception of latched
piezo switches will “bounce” for a varying time, depending on their physical characteristics. The default
debounce time for the module is about 52 mS, which is adequate for most membrane keypads. This time
equates to a setting of 8 using this command as there is a debounce time resolution of 6.554 milliseconds.
Downloaded from Elcodis.com electronic components distributor

VK202-25 rev. 05 20
5. Bar Graphs and Special Characters
The VK202-25 includes the ability to draw bar graphs (either horizontal or vertical) and allows users to
define up to eight special characters. Before issuing commands to the VK202-25 please read sections 7.2
and 7.3.
Eight characters (ASCII values 0x00 to 0x07) are set aside for use with bar graphs, user defined characters,
and big numbers. Since the same 8 characters are used for each function, the functions may not be used
simultaneously. The characters may 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. 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.
5.1.2 Initialize narrow vertical bar graph (254 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.
5.1.3 Draw vertical bar graph (254 61 [column] [height])
Draws a vertical bar graph in [column] having a height of [height] pixels. The height may range from 0 to
20 (0x00 to 0x14) pixels. The necessary characters must first be initialized by either of the commands
shown in section 5.1.1 or 5.1.2, which will determine the width of the graph drawn. Graph may be erased by
drawing a bar graph of height = 0 in the same column.
5.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.
5.1.5 Draw horizontal bar graph (254 124 [column] [row] [dir] [length])
Draws a horizontal bar graph in [row] starting at [column] with a length of [length] pixels. [row] may have a
value of 0x01 or 0x02, column may range from 0x01 to 0x14 and length may be from 0x00 to 0x64 (0 to
100) if the graph can extend the full width of the screen. Each column is 5 pixels wide (spaces between the
columns don't count).
[dir] specifies the direction: 0x00 goes from left to right, 0x01 goes from right to left.
5.1.6 Define custom character (254 78 [c] [8 bytes])
The VK202-25 allows up to 8 user defined (custom) characters. These characters occupy the first 8 (0x00 to
0x07) places in the character set (see Figure 3-1).
Downloaded from Elcodis.com electronic components distributor
Other manuals for VK202-25
1
Table of contents
Other Matrix Orbital Control Unit manuals
Popular Control Unit manuals by other brands

SimTech
SimTech SIMCom SIM7600E-PCIE Hardware design

GiBiDi
GiBiDi BX-6M manual

Krom Schroder
Krom Schroder BCU 46 Series operating instructions

GiBiDi
GiBiDi SC380 Instructions for installation

Delta
Delta MultiChoice Ara T27T867 Series owner's manual

Blue Technix
Blue Technix Sentis3D-M530 Hardware user manual