beautypg.com

2 flow control – Matrix Orbital LK162-12 Legacy User Manual

Page 31

background image

LK162-12 rev 4

31

6.1.17 Read Version Number (254 54)

This command will return the firmware version number of the LK162-12. The firmware version number is a 1-
byte hex value.

6.2 Flow Control

The LK162-12 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 (see Table 7-4 and the next two sections). If
flow control is enabled, the LK162-12 will return an "almost full" message (0xFE) to the controller when its
internal buffer fills to a defined level, and an "almost empty" message (0xFF) when the buffer contents drop
to a defined level.

6.2.1 Enter Flow Control Mode (254 58 [full][empty])

Note: Flow control applies only to the RS-232 interface. It is not available for I

2

C.

This command enables flow control. When the buffer fills so that only [full] bytes are available the LK162-12
will return an "almost full" message (0xFE) to the controller. When the buffer empties so that only [empty]
bytes remain the LK162-12 will return an "almost empty" message (0xFF) to the controller.

The LK162-12 will return the "almost full" message for every byte sent to the LK162-12 until the used buffer
space once more drops below the [full] level.

Whether the user is in ‘Flow Control Mode’ or not, the module will ignore display or command bytes which
would overrun the buffer. While in ‘Flow Control Mode’ the unit will return 0xFE when buffer is almost full
even though it may have already thrown rejected data away. The buffer size for the LK162-12 is 80 bytes.

When using this command in an application, selection of the value for the buffer almost full should be
considered very carefully. This is a critical aspect of using this command to it’s full potential. When using a
host system or PC which contains a FIFO, the user should set the value of [full] equal to or greater than the
size of the FIFO. The reason for this is that the FIFO may be full when the host system receives 0xFE. In the
case of 16550 UART the size at its maximum is 16, therefore the value of should be set to 16 or greater.

6.2.2 Exit Flow Control Mode (254 59)

This command turns off flow control. Bytes may overflow the buffer without warning.

6.2.3 GPO or Keypad Mode (254 37 [mode])

The LK162-12 shares GPO and keypad pins, you can use one of the other but not both at the same time.
To select either General Purpose Outputs or the Keypad Interface on the general purpose output/ keypad
connector, send a command prefix followed by the character ‘%’ followed by , where is either 0 or 1 (8 bit
binary).

0 = Keypad Interface Mode
1 = General Purpose Output Mode.