|
Instruction Set & Character Set |
|
|
Pertelian Instruction Set This is the instruction set of the Pertelian LCD. To issue an instruction, you must first issue a 0xFE hex (254 dec) command to set the LCD in instruction mode. The following byte is subsequently treated as an instruction. For example, to clear the display issue (0xFE 0x01). Further bytes are treated as data. | Instruction | Code | Description | Execution time | | DB7 | DB6 | DB5 | DB4 | DB3 | DB2 | DB1 | DB0 | | Set Instruction Mode | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | Sets the LCD to Instruction mode. The following byte is treated as an instruction. | 1.64mS | Pertelian instruction set | Instruction | Code | Description | Execution time | | DB7 | DB6 | DB5 | DB4 | DB3 | DB2 | DB1 | DB0 | | Clear display | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | Clears display and returns cursor to the home position (address 0). | 1.64mS | | Backlight Off | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | Turns the backlight off | 1.64mS | | Backlight On | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | Turns the backlight on | 1.64mS | | Entry mode set | 0 | 0 | 0 | 0 | 0 | 1 | I/D | S | Sets cursor move direction (I/D), specifies to shift the display (S). These operations are performed during data read/write. | 40uS | | Display On/Off control | 0 | 0 | 0 | 0 | 1 | D | C | B | Sets On/Off of all display (D), cursor On/Off (C) and blink of cursor position character (B). | 40uS | | Cursor/display shift | 0 | 0 | 0 | 1 | S/C | R/L | * | * | Sets cursor-move or display-shift (S/C), shift direction (R/L). DDRAM contents remains unchanged. | 40uS | | Function set | 0 | 0 | 1 | DL | N | F | * | * | Sets interface data length (DL), number of display line (N) and character font(F). | 40uS | | Set CGRAM address | 0 | 1 | CGRAM address | Sets the CGRAM address. CGRAM data is sent and received after this setting. | 40uS | | Set Display Data address | 1 | Offset. Row 1 starts at offset 0, Row 2 starts at offset 0x40, Row 3 starts at offset 0x14, Row 4 starts at offset 0x54. | Set the display data address to start displaying characters at.
| 40uS | | Write to CGRAM or DDRAM | write data | Writes data to CGRAM or DDRAM. See character codes below. | 40uS | Remarks: - DDRAM = Display Data RAM. - CGRAM = Character Generator RAM. - DDRAM address corresponds to cursor position. - * = Don't care. DL set 1 for 8 bit interface, 0 for 4 bit interface N set 1 for 2 lines, 0 for 1 line F set 0 for 5x8 dots S/C set 1 for Display shift, 0 for Cursor move R/L set 1 for Shift to the right, 0 for Shift to the left D set 1 for Display ON, 0 for Display OFF C set 1 for Cursor ON, 0 for Cursor OFF B set 1 for Cursor blinking I/D set 1 for Increment, 0 for Decrement S set 1 for Automatic display shift Pertelian 5x7 dot font character set  Pertelian Sample Initialization Sequence 0xFE; //Set instruction mode 0x38; //Function set with 8-bit data length, 2 lines, and 5x7 dot size 0xFE; 0x06; //Entry mode set; increment cursor direction; do not automatically shift 0xFE; 0x10; //Cursor/display shift; cursor move 0xFE; 0x0C; //Display On; cursor off; do not blink 0xFE; 0x01; //Clear display
|