0
Interfacing with a 122x32 GLCD
There are loads of graphical LCDs out there - and a whole range of different sizes, prices, functionality and more. Interfacing with each one is different every time, so finding the right display is a fine balancing act between ease-of-use, number-of-pins and cost.
While I'm waiting for my 122x32 GLCD to be delivered (only 99p each from eBay!) I've been working on how to actually display stuff with them! The datasheet(s) are quite vague, but it is possible to glean the basics from them:
The actual display uses TWO driver chips and the data you send to from the microchip is presented to both of them - you need to set a pin to tell the display which driver chip (master or slave) the instruction is intended for. It seems that you do this by making pin E1 high for the master driver (i.e. the top half of the display) or driving E2 high for the slave (the bottom half of the display).
The SED1520 driver chips do not support built-in characters/fonts, so to write characters on the display, it seems that you must create your own bitmap fonts and send the data across from the microchip, to display each miniature bitmap, one column at a time (since the data is transferred vertically on the data bus).
This means that a complete font set has to be designed and encoded.
I made my own font set using nothing more technical than a sheet of paper, a biro and the side of a CD case for drawing some straight lines! I made each font 8x5 pixels (a pretty standard size) but allowed a pixels space around each letter, so they are slightly smaller than most LCD fonts.
I then transferred these fonts into a custom-built VB application so that each character in the font set could be represented by 5 bytes of data. Now, when a character needs to be sent to the gLCD, the "row" (page) and "column" values can be set, and the data sent as a sequence of 5 bytes, to draw the letter as a bitmap on the display
While I'm waiting for my 122x32 GLCD to be delivered (only 99p each from eBay!) I've been working on how to actually display stuff with them! The datasheet(s) are quite vague, but it is possible to glean the basics from them:
The actual display uses TWO driver chips and the data you send to from the microchip is presented to both of them - you need to set a pin to tell the display which driver chip (master or slave) the instruction is intended for. It seems that you do this by making pin E1 high for the master driver (i.e. the top half of the display) or driving E2 high for the slave (the bottom half of the display).
Pin number | Symbol | Level | Description |
---|---|---|---|
1 | Vdd | 3V | Supply voltage |
2 | Vss | 0V | Ground reference |
3 | Vlcd | varies | Power for LCD display |
4 | reset | Low-to-High | Reset the system |
5 | E1 | H | Read/write enable (master) |
6 | E2 | H | Read/write enable (slave) |
7 | R/W | H/L | H=read, L=write |
8 | A0 | H/L | H=data, L=command |
9 | DB0 | 0/1 | Data bit 0 |
10 | DB1 | 0/1 | Data bit 1 |
11 | DB2 | 0/1 | Data bit 2 |
12 | DB3 | 0/1 | Data bit 3 |
13 | DB4 | 0/1 | Data bit 4 |
14 | DB5 | 0/1 | Data bit 5 |
15 | DB6 | 0/1 | Data bit 6 |
16 | DB7 | 0/1 | Data bit 7 |
17 | BLA | 3V | Back light anode |
18 | BLC | 0V | Back light cathode |
The SED1520 driver chips do not support built-in characters/fonts, so to write characters on the display, it seems that you must create your own bitmap fonts and send the data across from the microchip, to display each miniature bitmap, one column at a time (since the data is transferred vertically on the data bus).
This means that a complete font set has to be designed and encoded.
I made my own font set using nothing more technical than a sheet of paper, a biro and the side of a CD case for drawing some straight lines! I made each font 8x5 pixels (a pretty standard size) but allowed a pixels space around each letter, so they are slightly smaller than most LCD fonts.
I then transferred these fonts into a custom-built VB application so that each character in the font set could be represented by 5 bytes of data. Now, when a character needs to be sent to the gLCD, the "row" (page) and "column" values can be set, and the data sent as a sequence of 5 bytes, to draw the letter as a bitmap on the display
Post a Comment