LCD-Terminal Manual
LCD-Terminal LCD-Terminal: Manual Copyright © 2015 taskit GmbH All rights to this documentation and to the product(s) described herein are reserved by taskit GmbH. This document was written with care, but errors cannot be excluded. Neither the company named above nor the seller assumes legal liability for mistakes, resulting operational errors or the consequences thereof. Trademarks, company names and product names may be protected by law.
LCD-Terminal Table of Contents 1. Overview ...................................................................................................................... 1 2. Commissioning ............................................................................................................ 2 2.1. USB .................................................................................................................... 3 2.2. UART .................................................................................
LCD-Terminal List of Figures 2.1. 2.2. 2.3. 2.4. 4.1. 4.2. 4.3. 4.4. Pin-out LCDTerm12 .................................................................................................. 2 Pin-out LCDTerm15 .................................................................................................. 2 Pin-out LCDTerm25 .................................................................................................. 2 Pin-out LCDTerm35 ..................................................................
LCD-Terminal List of Tables 3.1. 3.2. 3.3. 3.4. 4.1. 4.2. 4.3. 4.4. Text functions ........................................................................................................... 4 Options ..................................................................................................................... 5 Graphic functions ..................................................................................................... 7 Additional functions ..............................................
LCD-Terminal List of Examples 2.1. 3.1. 3.2. 3.3. 4.1. Hello world on a Windows shell .............................................................................. 3 example1.lua ............................................................................................................. 6 example2.lua ............................................................................................................. 8 Activate bootloader from a Linux shell ......................................................
Overview 1. Overview The LCD-Term is a ready to use black-white display including VT100 support, three builtin fonts, matrix keyboard support, simple IO functionality and graphic routines such as drawing primitives, GIF images as well as blitting from and to multiple back-buffers. It is available in four physical display sizes from 1.2" to 3.5". Any headless hardware that shall be extended by some output capabilities or full user interaction can be connected to LCD-Term.
Commissioning 2. Commissioning Power is either be supplied via a 5V USB unit which is connected to micro USB port or via the side connectors using the 3.3V or 5V pin if available. Figure 2.1. Pin-out LCDTerm12 Figure 2.2. Pin-out LCDTerm15 Figure 2.3. Pin-out LCDTerm25 Figure 2.4.
Commissioning 2.1. USB When plugging a USB cable using the micro USB port X3, the device is enumerated as USB CDC device. Modern operating systems such as Windows 10, MAC OS X or Linux come with appropriate drivers pre-installed. After initialisation, a new communication device is added to the system. On Windows this is called //./COMx where x is a decimal number. Linux and UNIX-like systems in general use either /dev/ttyACMx or /dev/ttyUSBx as naming scheme.
Instruction set 3. Instruction set All instructions follow a basic scheme compatible with ANSI escape sequences. A sequence starts with an introductory character (hexcode 0x1B), in the following written as ESC, and is completed by either a upper- or lowercase basic latin letter (A-Z, a-z) representing a function code. Arguments to these functions are written as decimal integer numbers, separated by semi-colon, between ESC and the function code.
Instruction set Command Description Example LUA string J Erase display content according to option n. Options are: 0 = from cursor to end, 1 = from start to cursor, 2 = full display. Omitting n erases the whole display. ESC[2J ESC[J "\27[2J" K Erase line content according to option n. Options are: 0 = from cursor to line end, 1 = from line start to cursor, 2 = full line. Omitting n erases the current line from cursor to end. ESC[2K ESC[K "\27[2K" P Delete n characters right to the cursor.
Instruction set -- All commands will be sent using standard file IO -- on the USB CDC port my LCD-Term is connected to. -- On Linux it will be either "/dev/ttyACMx" or "/dev/ttyUSBx"; -- on Windows the device is "//./COMx". f = io.open("/dev/ttyACM0", "wb") function wait(seconds) local start = os.clock() repeat until os.clock() > start + seconds end function clear_display(f) f:write("\27[2J") f:flush() wait(0.01) end function clear_line(f) f:write("\27[2K") f:flush() wait(0.
Instruction set 3.2. Graphic functions Besides textual functionality, LCD-Term offers a set of sequences that can be used for drawing. Simple forms such as lines, rectangles and circles can be filled with different patterns, text can be positioned on a per pixel basis instead of a per character one, a screen can be prepared in a back buffer page and being blit to the front buffer. Icons and special symbols are supported through the GIF feature.
Instruction set Command Description Example LUA string ESC[modeU ESC[0U ESC[1U ESC[2U "\27[U" U Update screen: Depending on mode the function automatic update is disabled (mode = 0) or enabled (mode = 1). When mode is equal to 2 or omitted, the currently selected buffer is copied onto screen. W Blit source rectangle at [x0; y0] with ESC[src;x0;y0;dx;dy; "\27[1;10;20;16;16; size [dx; dy] to [x1; y1]. Source buffer dst;x1;y1W 0;0;0W" is src, target buffer is dst. ESC[1;0;0;32;32; 0;10;15W Table 3.3.
Instruction set if (x % 8) == 0 then wait(0.01) end end end -- draw frame f:write(string.format("\27[%d;%d;%d;%d;%dw", 0, 0, 63, 127, 4)) f:flush() if (graph_y > 4) and (graph_x > 4) then f:write(string.format("\27[%d;%d;%d;%d;%dw", graph_y - 4, graph_x - 4, graph_y + graph_dy + 3, graph_x + graph_dx + 3, 0)) f:flush() f:write(string.format("\27[%d;%d;%d;%d;%dv", graph_y - 2, graph_x - 2, graph_y + graph_dy + 1, graph_x + graph_dx + 1, 0x33)) f:flush() end wait(0.
Instruction set Command Description Example LUA string IO functionality a N Get pin level of requested IO pin n . ESC[2N "\27[4N" O Set pin level of selected IO pin n to level. ESC[2;0O ESC[2;1O "\27[1;1O" a Configuration a Q Enter LCD-Term's setup dialog. ESC[Q "\27[Q" e Jump into the device's bootloader. ESC[e "\27[e" See Section 4.2, “General pin-out” for details about n. Table 3.4.
Technical data 4. Technical data Specification Value Unit LCD-Term12 LCD-Term15 LCD-Term25 LCD-Term35 Power supply 3.3 .. 5 V Power consumption (min.) 38 mW Power consumption (max.) 160 mW Operating temperature -30 .. +85 °C Resolution 128 x 64 Pixel Width 25 29.4 43.2 53 mm Length 49.1 59.3 74.4 94.8 mm Height 5.5 6.0 6.8 7.5 mm 26.8 x 12.0 35.8 x 19.8 47.3 x 26.2 66.5 x 33.2 mm 5 8 12 14 Pixel array IO pins 2 Table 4.1.
Technical data 4.2. General pin-out All pins labeled PAxx / IOyy can be used as IO pins. They are referenced in LCD-Term's setup and IO functions as IOyy. The pin-out tables contain the mapping between a connector's pin number and the IOyy pins for the different LCD-Term boards. echo -e -n "\033[3;0O" > /dev/ttyACM0 1 Example 4.1. Setting IO03 to low level. 4.2.1. Left connector This connector basically contains the serial interface and power supply.
Technical data Pin a Description LCD-Term12 (X2) LCD-Term15 (X2) LCD-Term25 (X2) LCD-Term35 (X4) 2 PA00 / IO00 GND GND 3.
Technical data 2 Figure 4.3. LCDTerm25 dimensions 2 Figure 4.4.