Go back to the PmodCLS Resource Center
Welcome to the FAQ / User Guide for the PmodCLS! As questions come up, either through the Digilent Forum or otherwise, they will be addressed here in this document.
Instruction | Result |
<row>;<col>H | set cursor position to <row>, <col> |
s | save cursor position |
u | restore saved cursor position |
j | clear display and home cursor |
<ps>K | erase within line, 0 = current position to end of line, 1 = start of line to current position, 2 = entire line |
<ps>N | erase field in current line <ps> = number of chars starting at current position |
<pn>@ | scroll left <pn> columns |
<pn>A | scroll right <pn> columns |
* | reset: equivalent to cycling power of PmodCLS |
<ps>h | set display mode, 0 = wrap line at 16 character, 1 = wrap line at 40 characters |
<ps>c | set cursor mode, 0 = cursor off, 1 = cursor on, blink off, 2 = cursor on, blink on |
<pn>a | save TWI address in EEPROM to <pn> |
<pn>b | save baud rate value in EEPROM to <pn> |
<pt>p | program character table into LCD |
Instruction | Result |
<pt>t | save RAM character table to EEPROM |
<pt>l | load EEPROM chracter table to RAM |
<pn>…<pn>;<ps>d | define user programmable character |
<ps>m | save communication mode to EEPROM |
w | enables write to EEPROM |
<ps>n | save cursor mode to EEPROM |
<ps>o | save display mode to EEPROM |
Symbol | Definition |
<pr> | row number (0-1) |
<pc> | column number (0-39) |
<pn> | numeric parameter (decimal, hex, or binary) |
<ps> | decimal selection parameter |
<pt> | character table selector (0-2 in EEPROM, 3 in RAM) |
The module can display up to eight custom characters at a time, but is capable of storing four sets of eight characters. This consists of three stored character tables in EEPROM and one table loaded into the LCD’s RAM.
To create a new custom character, send the command (ESC)[<pn>…<pn>;<ps>d where <pn> is a numeric parameter that describes a row in the character and <ps> is a decimal selection parameter (0 through 7.) A custom character definition contains eight rows, so the escape sequence to define one must have eight <pn> values followed by the <ps> value that specifies the character being defined.
To create a new character, first draw out the pattern. Then, determine the numerical value of each row in the character. Note that the left-most segment is the most significant bit. Record each row, from top to bottom, and record which character in the table to save it to. Each row of the character contains six pixels so only the low six bits of each value are used.
For example, the following character would saved by writing:
lcdChar(0x1B); lcdString(“[14;31;21;31;23;16;31;14;0d”);
where lcdChar() and lcdString() are functions that write characters and arrays of characters.
The above command saves the character to the '0' address in the LCD's RAM table. To display this character, send the numerical value of the address character. In this example, it is performed by writing lcdChar(0x00);
The character will appear at the location of the LCD's cursor.