The WS0010 is an organic light-emitting diode (OLED) alphanumeric display with built-in character generator for four character sets. OLED-based displays are usually extremely bright and provide a superior contrast when compared to LCD displays.
16 common × 100 segment OLED
This driver chip is very versatile and scalable. You can use only one chip to make a small display, or multiple chips connected together to make a very large display. Let us start with a simple display consisting of only one chip. A single chip on its own can drive an LCD matrix consisting of 16 dots × 100 dots, which is the maximum capability of this one chip.
Therefore, if your characters are eight dots high and five dots wide then you can have 20 characters per line, and a maximum of two lines of text. There is also the option to use characters that are 10 dots high, in which case you can only have one line of 20 characters.
It should be noted that when an eight dot high character is quoted, only seven dots are used for the actual character and one dot reserved for the cursor which appears below the character. The same also goes with the 10 dot high characters, only 9 dots are actually used.
A manufacturer should always provide a block diagram to show how the WS0010 driver chips are internally organised and connected to drive the dots.
The WS0010 has 16 common drivers, and 100 segment drivers. Hence, the maximum number of rows a single WS0010 can drive is 16, and the maximum number of columns it can drive is 100. When a display is required to be larger with say more rows, an additional WS0010 driver chip may be utilised in addition. Hence, two chips can drive a larger display matrix consisting of 100 columns and 32 rows. It is therefore possible to connect multiple driver chips to make large display panels.
When a display contains two WS0010 driver chips, a unique problem occurs because there is only one data bus, and one set of control connections. Hence, both chips share these. Therefore, the manufacturers have provided chip select pins to the LCD interface called CS1 and CS2, and they determine which chip receives the data and control signal input, as well as command codes. It is the programmer’s job to set these control lines accordingly through his software and select the correct chip at the correct time.
How these chips operate together and whether they operate together at all is important to understand. Moreover, this arrangement differs depending upon the model. If you look at the pinout of your LCD module and it has two pins marked CS1 and CS2, then chances are that you will be treating each half of the display as separate entities.
This can be a real pain for programming because if you want to display a block of text that occupies four lines (when using eight dot high characters), you will have to keep a track of the row and columns that are used on the physical display.
Once you have filled up lines 1 and 2 in the first half of the display, you then have to set CS2 so that the data on the data bus goes into the second controller chip to display on the second half of the panel for lines 3 and 4.
From a programming perspective, the CS1 and CS2 control lines must toggle so that when one is ON the other is OFF. It is probably a good idea to think of them as two separate panels from a software programming point and being aware of the column and row positions, and setting them as required and switching between the two halves at the correct time.
Graphic and Text Display
Currently there are a large number of displays on the market, and some displays are character displays, which are for displaying only characters from a pre-set character tables within the ROM memory. You cannot manipulate the individual dots with those displays.
Then there are also graphics displays, for displaying graphics only. Then there are those that do both text and graphics and there is facility provided to the programmer to switch between the graphic and text modes. These dual mode ones offer the programmer the simplicity of displaying pure text, and the benefits of displaying custom graphics. The WS0010 controller chip is capable of operating in both graphic and character modes. However, you cannot have both modes at the same time though. The chip has a command instruction for changing between these two modes.
If your display module does not have CS1 and CS2 chip select pins, but you know that it contains two WS0010 driver chips, then chances are that the display module is for the purposes of displaying characters only. Usually, there is additional circuitry within the module that automatically tracks the columns and rows and takes care of the CS1 and CS2 switching automatically, hence, CS1 and CS2 are not exposed.
If your module has CS1 and CS2 pins then chances are that it will be a graphic display, because you need to access all the dots on both halves of the display manually. Hence, from a programming point you have to do everything, choose which half of the display you want, which column you want, which row you want, and then byte level masking to select the actual bit within a byte you wish to set...
Setting Graphics Mode
There is very little information available regarding mode switching between character and graphic, but the principle is that you cannot do both at the same time. In character mode, you have the advantage of displaying characters with minimal programming; in graphic mode, you have the advantage and complexity of displaying custom graphics. The programmer can switch from one mode to the other. In graphics mode, you will have to control CS1 and CS2 yourself obviously.
For display modules that can display both graphics and characters. The mode is set by way of an instruction sent to the instruction register. DB3 is sometimes the bit assigned for selecting the mode. When DB3 = zero Character Mode is selected, and if DB3 = one then graphics mode is selected. This bit is one of a group of bits DB0, DB1, DB2, so they are set together. DB0 and DB1 are fixed to 1, whilst DB2 is the power bit to control the internal DC-DC power circuitry. This would suggest that the power bit and mode bit are set together.
Keeping things simple, if the DC-DC power circuitry is to remain on and keeping DB2 fixed to logic 1. The command code to send to the instruction register would be the following.
- Binary “0 0 0 0 0 1 1 1 1 1” sets power ON and graphic mode.
- Binary “0 0 0 0 0 1 0 1 1 1” sets power ON and character mode.
More information is required regarding mode switching, because the documentation does not indicate if this works on the fly. Obviously, that would be ideal, as one may want to alternate between displaying text and graphics. On the other hand, is this something that can be set only once during the power on sequence in the initialization section of the programmer’s code.
Using the Graphics Mode
In graphics mode, you would no longer be using any pre-set character tables stored in CGRAM or CGROM, because that is for character mode display. Therefore, you would no longer be sending character codes to the Display RAM. This suggests that in graphics mode what you write to the Display RAM maps directly to the display dots.
For graphics mode usage, there is some information I was not able to find. There is not much information available on how a byte of data sent to the Display RAM would organise or map to the actual dots on the LCD display. However, this is easily discoverable by sending a byte pattern such as “11111111” to the Display RAM, and seeing where it lands on the display.
On the KS0108 driver chip, the first byte orients vertically on the LCD starting on the top-left corner of the LCD, of the first column, on the top-half of the LCD. There is a counter mechanism that automatically increments the column address for the next column so that when a second byte is sent it fills 8 dots in the next column alongside the previous eight...
However, some driver chips will orient those eight dots horizontally starting from the top-left corner, top-half of the LCD, first row. The next byte pattern “11111111” sent will fill up a row of 8 dots below the previous... It is also important to determine if any counter mechanisms automatically increment the row address, because there usually are. This can be figured out by sending multiple bytes consisting of “11111111” and seeing where they land.
Displays that can do both character and graphic display normally orient the 8 dots horizontally as this is how the internal circuitry is arranged to print the character bitmap row-after-row. Please refer to the following section of this article: Understanding font tables.
If they are filling up horizontally, what happens with the ninth byte? Does that fill up below the eighth row or does it automatically jump to column 9, row 1 and begin filling from there. Alternatively, does it simply continue all the way down to row 16? It is important to know these basic operation parameters and any automation. If these can be determined then it can provide the basis for some good programming functions.
In the example above, we extended the size of the LCD by adding more rows, which was the equivalent to using double-sided tape, and sticking another display below the first one and sharing the data and control lines. However, there are some display modules where the columns extend instead of the rows. In those display modules there are two WS0010 chips connected in cascade mode, and therefore the display will not have CS1, CS2 pins. In this mode one chip is designated the master and the other the slave. Their data buses are also cascaded so that effectively you can display a long line of scrolling text. This article does not relate to those types of displays.
This article is getting way too long and I'm not actually writing a PhD thesis, so if there is any interest, and it receives hits then I might add more information if time permits.
This Article Continues...Winstar WS0010
WS0010 Memory Organisation
Understanding the WS0010 Font Table