Picture of ST7565 LCDs: Graphical LCDs!

What it is... Introduction:

     This mini-tutorial will go through the process of setting up a ST7565 LCD. These LCDs are      graphical which means they can display pixels, not just text. This type of LCD in particular has 128x64 pixels, which appear dark gray on a green-blue background. They have a backlight but can also be used without the light on for daytime visibility.

      Another kind of LCD is the KS0108-type. These are not the same and are not compatible! Here are some comparisons

  KS0108 ST7565
Data pins needed
4 or 5
Display size
Contrast adj.
requires potentiometer
internal, no extras!
Buffer needed?


As you can see there are a few differences.

  • For one the ST7565 runs at 3.3V not 5. This means a buffer chip or level shifting is necessary, you can use resistors or a chip like the 4050 (or equiv).
  • Second, the interface is Serial (one bit at a time) instead of Parallel (8 bits at a time). This means it uses waaay fewer pins (yay!)
  • The biggest downside is that you can't read from the LCD in serial mode, only write. This means that the chip has to keep track of the display (the KS0108 lets you read or write). So whatever microcontroller you use will need to spend 1024 bytes (1Kb) of RAM on the display memory. For some chips this is a little and some its a lot - you will need to check the micro's datasheet.

     If you are using an ATmega168 or ATmega8 such as used in older Arduinos you must upgrade to a '328 to use this LCD. And if you're using a '328 note that half the RAM is going to the display so you wont have a lot left over. This pretty much means you can't use something with an SD card (like a Wave Shield or Data logger Shield at the same time you will straight-up run out of RAM and it will be weird so don't bother).

wisp4 years ago
My bad - I didn't read the code first...
Instead of deleting my comment though, I'll annotate it in case anyone else has the same question:

from ST7565.h:
class ST7565 {
ST7565(int8_t SID, int8_t SCLK, int8_t A0, int8_t RST, int8_t CS) :sid(SID), sclk(SCLK), a0(A0), rst(RST), cs(CS) {}
ST7565(int8_t SID, int8_t SCLK, int8_t A0, int8_t RST) :sid(SID), sclk(SCLK), a0(A0), rst(RST), cs(-1) {}

so the optional pin is CS - Chip Select. From the datasheet:
" Chip Select Input There are /CS1 pins for chip selection. The LCM can interface with an MPU only when /CS is "L" . When these pins are set to any other combination, RS, E_RDB, and RW_WRB inputs are disabled and DB0 to DB7 are to be high impedance. And, in case of serial interface, the internal shift register and the counter are reset. "

so... since it defaults to 'L' and that mode is what allows interface with an MPU (which is what I want) - I'll try without.
wisp4 years ago
Great write up, thank you!
I just ordered one of these from you and had a quick question. You mention above that the lcd requires 4 or 5 data pins. Which pin is the optional one and what functionality does it remove? (at a guess, I'm going to say /rst as it seems like one probably doesn't _need_ to reset). Apologies if I missed this in the write-up above - thanks for any additional info.

Low on pins... as always.