Display
From S1MP3 Wiki
Contents |
introduction
Always wired differently, although the LCD controller is probably always connected to the same MCU pins. It uses the same external memory bus as the NAND chip. One can use the Screen detector program to find out how id the display mapped.
Here is a list of some display devices used on s1mp3s :
- 132*32 (samsung s6b0724 datasheet)
- 128*64 (Area Colour OLED)
- 1*6 (7 segments display b/w)
- 128x160 TFT Color Display
Ports/Pins
RS (or A0)
Used for set the LCD to Command[0] or Data[1] Mode. Usually connected to a GPIO Port
- RS-Port: GPIO_C
- RS-Bit: Bit 2
RD/WR (Read/Write)
Used to Read[RD] or Write[WR] to the LCD. Connected to External Memory Bus Read/Write (MRD#, MWR#)
CS (Chip Select)
Used to Enable the LCD for commands. Connected to Chip Enable 3 (CS3#)
LCDRST (LCD Reset)
Used to Reset the LCD. It starts the LCD reset sequence on the LCD. Usually connected to a GPIO Port
- RS-Port: ?
- RS-Bit: ?
Note
- RS is set via GPIO Ports to send commands to LCD.
- RD/WR is handled automagicly when you read or write to LCD memory region (0x8000-0xFFFF).
- When EM High Page Register is set to CE3, memory read/write from 0x8000 to 0xFFFF enables the CS3# line.
- LCDRST When high it starts the LCD reset sequence, but on some displays the LCD isn't turned on after this, so you will need to send the command to turn on the LCD.
To select CS3# mapping, you have to do the following:
ld a, 0x18 ; CE3 out (0x2),a ; EM High Page Register (0x8000-0xFFFF)
Details from the LCD controller
When the screen is black/white, one pixel is equal to 1 bit (so the format can be called "planar" by opposition to the "chunky" indexed format where 1 byte = 1 pixel).
So, if the size of the screen is 128 x 32 pixels, in memory, a full screen picture takes 4 * 128 bytes = 512 bytes.
Bits are gathered vertically, 1 byte contains the bits for 1 column of 8 pixels.
And then horizontally so byte 0 = column 0, byte 1 = column 1, etc.
Sending a byte (8 pixels) to the lcd screen will increase the column register by 1 so 128*8 pixels can be pushed at one time easily by the processor. When the column 127 is reached LCD_SET_PAGE register must be increased by 1 to be able to access to the next page of pixels and the column registers must be cleared, the whole process is repeated for the 4 pages of pixels.
Byte 0: 8-pixels column 0 / row 0 to 7
Byte 1: 8-pixels column 1 / row 0 to 7
Byte 2: 8-pixels column 2 / row 0 to 7
...
Byte 128: 8-pixels column 0 / row 8 to 15
Byte 129: 8-pixels column 1 / row 8 to 15
Byte 130: 8-pixels column 2 / row 8 to 15
...
Byte 256: 8-pixels column 0 / row 16 to 23
Byte 257: 8-pixels column 1 / row 16 to 23
Byte 258: 8-pixels column 2 / row 16 to 23
...
Byte 384: 8-pixels column 0 / row 24 to 31
Byte 385: 8-pixels column 1 / row 24 to 31
Byte 386: 8-pixels column 2 / row 24 to 31
...
Byte 511: 8-pixels column 127 / row 24 to 31
Organization of bytes & bits:
Page 0
Byte # 0 1 ... 127 -- X axis
Bit # / Row # 0 / 0 0 / 0 ... 0 / 0
1 / 1 1 / 1 ... 1 / 1
2 / 2 2 / 2 ... 2 / 2
3 / 3 3 / 3 ... 3 / 3
4 / 4 4 / 4 ... 4 / 4
5 / 5 5 / 5 ... 5 / 5
6 / 6 6 / 6 ... 6 / 6
7 / 7 7 / 7 ... 7 / 7
Page 1
Byte # 0 1 ... 127 -- X axis
Bit # / Row # 0 / 8 0 / 8 ... 0 / 8
1 / 9 1 / 9 ... 1 / 9
2 /10 2 /10 ... 2 /10
3 /11 3 /11 ... 3 /11
4 /12 4 /12 ... 4 /12
5 /13 5 /13 ... 5 /13
6 /14 6 /14 ... 6 /14
7 /15 7 /15 ... 7 /15
Page 2
Byte # 0 1 ... 127 -- X axis
Bit # / Row # 0 /16 0 /16 ... 0 /16
1 /17 1 /17 ... 1 /17
2 /18 2 /18 ... 2 /18
3 /19 3 /19 ... 3 /19
4 /20 4 /20 ... 4 /20
5 /21 5 /21 ... 5 /21
6 /22 6 /22 ... 6 /22
7 /23 7 /23 ... 7 /23
Page 3
Byte # 0 1 ... 127 -- X axis
Bit # / Row # 0 /24 0 /24 ... 0 /24
1 /25 1 /25 ... 1 /25
2 /26 2 /26 ... 2 /26
3 /27 3 /27 ... 3 /27
4 /28 4 /28 ... 4 /28
5 /29 5 /29 ... 5 /29
6 /30 6 /30 ... 6 /30
7 /31 7 /31 ... 7 /31
|
|
Y axis
Bit set = foreground color (usually black) Bit clear = background color (depends on the led(s)).

