Difference between revisions of "LCD Controller"

From SublabWiki
Jump to: navigation, search
(Data reads/writes)
(LCD Controller Commands)
Line 50: Line 50:
| 1100 x???
| 1100 x???
| Set scan direction (rows)
| Set scan direction (columns)
| x = 0 (normal from row 0 to 63) or 1 (from row 63 to 0 - horizontal mirror)
| x = 0 (normal from columns 0 to 63) or 1 (from column 63 to 0 - horizontal mirror)

Revision as of 18:53, 26 April 2010

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.

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.

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 datasheets holds much more commands that are hard to verify or didn't work on the PM.

LCD Commands
Command Description Notes
0000 xxxx Set Column (low nibble) xxxx = Column (low nibble)
0001 0xxx Set Column (high nibble) xxxx = Column (high nibble)
1011 xxxx Set Page xxxx = Page (0-7, each page is 8px high)
1000 0001 Set Contrast Next write to FE or FF sets Constrast Level ($00-$3F)
1010 011x Invert Display select x = 0 (normal) or 1 (invert)
1010 111x Display ON/OFF x = 0 (off) or 1 (on)
1010 010x Entire Display select x = 0 (normal) or 1 (all Pixels on)
1100 x??? Set scan direction (columns) x = 0 (normal from columns 0 to 63) or 1 (from column 63 to 0 - horizontal mirror)

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.