Friday, October 15, 2004

LCD Pin Layout

Row 1 = positions 0..15 (dec)
Row 2 = positions 64..79 (dec)

Instruction set

Instruction               Code                                   Execution time**
                          RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
Clear display             0   0   0   0   0   0   0   0   0   1      1.64mS
Cursor home               0   0   0   0   0   0   0   0   1   *      1.64mS
Entry mode set            0   0   0   0   0   0   0   1  I/D  S        40uS
Display On/Off control    0   0   0   0   0   0   1   D   C   B        40uS
Cursor/display shift      0   0   0   0   0   1  S/C R/L  *   *        40uS
Function set              0   0   0   0   1   DL  N   F   *   *        40uS
Set CGRAM address         0   0   0   1   ----CGRAM address----        40uS
Set DDRAM address         0   0   1   ------DDRAM address------        40uS
Read busy-flag and        0   1   BF  --CGRAM / DDRAM address--         0uS
address counter
Write to CGRAM or DDRAM   1   0   ----------write data---------        40uS
Read from CGRAM or DDRAM  1   1   ----------read data----------        40uS

Remarks:
- * = Don't care.
- ** = Based on Fosc = 250kHz.

Description

  • Clear display - Clears display and returns cursor to the home position (address 0).
  • Cursor home - Returns cursor to home position (address 0). Also returns display being shifted to the original position. DDRAM contents remains unchanged.
  • Entry mode set - Sets cursor move direction (I/D), specifies to shift the display (S). These operations are performed during data read/write.
  • Display On/Off control - Sets On/Off of all display (D), cursor On/Off (C) and blink of cursor position character (B).
  • Cursor/display shift - Sets cursor-move or display-shift (S/C), shift direction (R/L). DDRAM contents remains unchanged.
  • Function set - Sets interface data length (DL), number of display line (N) and character font(F).
  • Set CGRAM address - Sets the Character Generator RAM address. CGRAM data is sent and received after this setting.
  • Set DDRAM address - Sets the Display Data RAM address. DDRAM address corresponds to cursor position. DDRAM data is sent and received after this setting.
  • Read busy-flag and address counter - Reads Busy-flag (BF) indicating internal operation is being performed and reads CGRAM or DDRAM address counter contents (depending on previous instruction).
  • Write to CGRAM or DDRAM - Writes data to CGRAM or DDRAM.
  • Read from CGRAM or DDRAM - Reads data from CGRAM or DDRAM.
Bit name  Setting / Status
  I/D     0 = Decrement cursor position  1 = Increment cursor position
   S      0 = No display shift           1 = Display shift
   D      0 = Display off                1 = Display on
   C      0 = Cursor off                 1 = Cursor on
   B      0 = Cursor blink off           1 = Cursor blink on
  S/C     0 = Move cursor                1 = Shift display
  R/L     0 = Shift left                 1 = Shift right
   DL     0 = 4-bit interface            1 = 8-bit interface
   N      0 = 1/8 or 1/11 Duty (1 line)  1 = 1/16 Duty (2 lines)
   F      0 = 5x7 dots                   1 = 5x10 dots
   BF     0 = Can accept instruction     1 = Internal operation in progress
{ "loggedin": false, "owner": false, "avatar": "", "render": "nothing", "trackingID": "UA-36983794-1", "description": "", "page": { "blogIds": [ 223 ] }, "domain": "holtstrom.com", "base": "\/michael", "url": "https:\/\/holtstrom.com\/michael\/", "frameworkFiles": "https:\/\/holtstrom.com\/michael\/_framework\/_files.4\/", "commonFiles": "https:\/\/holtstrom.com\/michael\/_common\/_files.3\/", "mediaFiles": "https:\/\/holtstrom.com\/michael\/media\/_files.3\/", "tmdbUrl": "http:\/\/www.themoviedb.org\/", "tmdbPoster": "http:\/\/image.tmdb.org\/t\/p\/w342" }