Difference between revisions of "LCD Controller"

From SublabWiki
Jump to: navigation, search
(LCD Controller Commands)
(LCD Controller Commands: Revised and added extra commands)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== LCD Controller Overview ==
 
== LCD Controller Overview ==
  
The Pokemon Mini LCD is a serial display with it's own on-board framebuffer, and display settings. These are all abstracted by the PRC, which handles display copies ($1000 ~ $12FF) and other various functions. No commercial roms directly access the display, relying on the PRC and BIOS to perform the various communications. This allows for the PM to have hardware changes without having to rely on the same display controller.  
+
The Pokemon Mini LCD is a serial display with it's own on-board framebuffer, and display settings. These are all abstracted by the [[PM_PRC|PRC]], which handles display copies ($1000 ~ $12FF) and other various functions. No commercial roms directly access the display, relying on the PRC and BIOS to perform the various communications. This allows for the PM to have hardware changes without having to rely on the same display controller.  
  
 
The display is driven by two data ports, $20FE and $20FF. Both ports are read\write, the only difference between them is one sets the CTRL line when accessing the data port on the LCD. The port is 8-bits wide, and has a small set of standard commands.
 
The display is driven by two data ports, $20FE and $20FF. Both ports are read\write, the only difference between them is one sets the CTRL line when accessing the data port on the LCD. The port is 8-bits wide, and has a small set of standard commands.
  
The LCD is probably using the on-glass [http://www.solomon-systech.com/products/ssd1828.htm SSD1828 LCD controller] or something very simliar.
+
The LCD is probably using the on-glass <S>[http://www.solomon-systech.com/products/ssd1828.htm SSD1828 LCD controller] or something very simliar.</S>[http://www.bolymin.com.tw/Doc/SED1565.pdf SED1565 LCD Controller]
  
The controller got 96x65 Graphic Display Data RAM (GDDRAM). The additional RAM is for an unused symbol driver. The PM most likely uses a parallel interface to the controller, but serial interface might be available on the connector of the LCD.
+
The controller got <S>96x65</S> 132x65 Graphic Display Data RAM (GDDRAM) with 96x64 pixels visible on the LCD. The additional RAM is for an unused symbol driver. The PM most likely uses a parallel interface to the controller, but serial interface might be available on the connector of the LCD.
  
 
== LCD Controller Commands ==
 
== LCD Controller Commands ==
Line 13: Line 13:
 
Lower case "x" denotes parameters used by the command. A question mark "?" denotes bits that are don't care.
 
Lower case "x" denotes parameters used by the command. A question mark "?" denotes bits that are don't care.
  
The commands in this list are verified to work. The SSD1828 datasheets holds much more commands that are hard to verify or didn't work on the PM.
+
The commands in this list are verified to work. The <S>SSD1828</S> datasheet holds <S>much</S> more commands <S>that are hard</S>of which a few are hard to verify <S>or didn't work</S> on the PM.
  
 
{| border="1"
 
{| border="1"
Line 23: Line 23:
 
| 0000 xxxx
 
| 0000 xxxx
 
| Set Column (low nibble)
 
| Set Column (low nibble)
| xxxx = Column (low nibble)
+
| xxxx = Column 0-15 (low nibble)
 
|-
 
|-
 
| 0001 0xxx
 
| 0001 0xxx
 
| Set Column (high nibble)
 
| Set Column (high nibble)
| xxxx = Column (high nibble)
+
| xxxx = Column 0-8 (high nibble)
 +
|-
 +
| 01xx xxxx
 +
| Display Start line
 +
| xxxxxx = 0-63 first line on display
 
|-
 
|-
 
| 1011 xxxx
 
| 1011 xxxx
 
| Set Page
 
| Set Page
| xxxx = Page (0-7, each page is 8px high)
+
| xxxx = Page (0-8, pages 0-7 are 8px high, Page 8 = 1px high)
 
|-
 
|-
 
| 1000 0001
 
| 1000 0001
 
| Set Contrast
 
| Set Contrast
 
| Next write to FE or FF sets Constrast Level ($00-$3F)
 
| Next write to FE or FF sets Constrast Level ($00-$3F)
 +
|-
 +
| 1010 000x
 +
| Segment Driver Direction Select
 +
| x=0 (Normal) 1 (Reverse) Note on Reverse 131 is the leftmost pixel and 36 the rightmost visible pixel. Pixels 35-0 are not visible. This command only affects the addressing arithmetics on the next read/writes and does not change any data that is already displayed.
 +
|-
 +
| 1010 001x
 +
| LCD Voltage Bias
 +
| x=0 (1/9th = normal) 1 (1/7th = darker )
 +
|-
 +
| 1010 010x
 +
| Entire Display select
 +
| x = 0 (normal) or 1 (all Pixels on)
 
|-
 
|-
 
| 1010 011x
 
| 1010 011x
 
| Invert Display select
 
| Invert Display select
| x = 0 (normal) or 1 (invert)
+
| x = 0 (normal) or 1 (invert) effective immediately. Ram is not affected.
 
|-
 
|-
 
| 1010 111x
 
| 1010 111x
Line 45: Line 61:
 
| x = 0 (off) or 1 (on)
 
| x = 0 (off) or 1 (on)
 
|-
 
|-
| 1010 010x
+
| 1100 x???
| Entire Display select
+
| Set scan direction (rows)
| x = 0 (normal) or 1 (all Pixels on)
+
| x = 0 (normal from row 0 to 63) or 1 (from row 63 to 0 - verical mirror)
 +
|-
 +
| 1110 0000
 +
| Read Modify Write
 +
| A read to display ram wil not advance the ram pointer. Only a write will advance the ram pointer. When active, column commands are not available.
 +
|-
 +
| 1110 1110
 +
| End
 +
| Ends Read Modify Write mode.
 +
|-
 +
| 1110 0010
 +
| Reset
 +
| Initializes Display.
 
|-
 
|-
| 1100 x???
+
| 1110 0011
| Set scan direction (columns)
+
| NOP
| x = 0 (normal from columns 0 to 63) or 1 (from column 63 to 0 - horizontal mirror)
+
| No Operation. Also used to exit test mode.
 
|}
 
|}
  

Latest revision as of 01:27, 21 May 2011

LCD Controller Overview

The Pokemon Mini LCD is a serial display with it's own on-board framebuffer, and display settings. These are all abstracted by the PRC, which handles display copies ($1000 ~ $12FF) and other various functions. No commercial roms directly access the display, relying on the PRC and BIOS to perform the various communications. This allows for the PM to have hardware changes without having to rely on the same display controller.

The display is driven by two data ports, $20FE and $20FF. Both ports are read\write, the only difference between them is one sets the CTRL line when accessing the data port on the LCD. The port is 8-bits wide, and has a small set of standard commands.

The LCD is probably using the on-glass SSD1828 LCD controller or something very simliar.SED1565 LCD Controller

The controller got 96x65 132x65 Graphic Display Data RAM (GDDRAM) with 96x64 pixels visible on the LCD. The additional RAM is for an unused symbol driver. The PM most likely uses a parallel interface to the controller, but serial interface might be available on the connector of the LCD.

LCD Controller Commands

Lower case "x" denotes parameters used by the command. A question mark "?" denotes bits that are don't care.

The commands in this list are verified to work. The SSD1828 datasheet holds much more commands that are hardof which a few are hard to verify or didn't work on the PM.

LCD Commands
Command Description Notes
0000 xxxx Set Column (low nibble) xxxx = Column 0-15 (low nibble)
0001 0xxx Set Column (high nibble) xxxx = Column 0-8 (high nibble)
01xx xxxx Display Start line xxxxxx = 0-63 first line on display
1011 xxxx Set Page xxxx = Page (0-8, pages 0-7 are 8px high, Page 8 = 1px high)
1000 0001 Set Contrast Next write to FE or FF sets Constrast Level ($00-$3F)
1010 000x Segment Driver Direction Select x=0 (Normal) 1 (Reverse) Note on Reverse 131 is the leftmost pixel and 36 the rightmost visible pixel. Pixels 35-0 are not visible. This command only affects the addressing arithmetics on the next read/writes and does not change any data that is already displayed.
1010 001x LCD Voltage Bias x=0 (1/9th = normal) 1 (1/7th = darker )
1010 010x Entire Display select x = 0 (normal) or 1 (all Pixels on)
1010 011x Invert Display select x = 0 (normal) or 1 (invert) effective immediately. Ram is not affected.
1010 111x Display ON/OFF x = 0 (off) or 1 (on)
1100 x??? Set scan direction (rows) x = 0 (normal from row 0 to 63) or 1 (from row 63 to 0 - verical mirror)
1110 0000 Read Modify Write A read to display ram wil not advance the ram pointer. Only a write will advance the ram pointer. When active, column commands are not available.
1110 1110 End Ends Read Modify Write mode.
1110 0010 Reset Initializes Display.
1110 0011 NOP No Operation. Also used to exit test mode.

Data reads/writes

Data can be read and written from/to the LCD at any time (but not when contrast command was executed, this is a special case). The programmer should make sure that the page and column address pointers are pointing to the correct location.

When data was read or written the column address automatically increases by one.

After executing page address and both of the column address set operations data can be written to the selected location.