The GLCD has a 128×64 resolution. This equals about 8192 individual pixels that you can control as you wish. But how is this done? Let’s see how we reach a particular pixel on the screen.
The LCD screen is actually divided into 2 halves with one KS0108 IC for each half. Each KS0108 IC has the ability to control 64×64 pixels, so both of them side-by-side should be able to give you the complete resolution of 128×64. So, by choosing which one of the two ICs, you can narrow your pixel down to one of the two halves.
Next, each half containing 64×64 pixels has an addressing scheme using the Y address and X address as follows. Lets start with the columns. Each half has 64 columns numbered from 0 to 63. Straightforward enough, not too much to get confused about, each column is addressed using the Y address which ranges from 0 to 63.
But each column (of 64 pixels) is broken down into 8 pages or segments of 1 byte each. Let’s spend a moment here and it’s even worth repeating – Each column is broken down into 8 pages of 1 byte each. This means each column has 8 bytes which equals 64 bits. Depending on whether the bit in each of the 8 bytes is HIGH(1) or LOW (0), the corresponding pixel is toggled on or off. The pages are addressed using the X address which ranges from 0 to 7.
Here is the most important point – In every instruction to display data on the screen, we pass one byte of information which tells which pixel to turn on and which one to turn off at the specified Y and X position.
So effectively, this requires four separate sequences of instructions:
- Specify which half to use
- Specify the Y address
- Specify the X address
- Specify which pixels to turn on and off through one byte of data
The diagram below gives an overview of how the screen is broken down:
In the next part we’ll cover how the instructions are sent to the display