Graphics Display ST7565 with Explore M3
The ST7565 in another popular controller for graphics displays. We will use the Adafruit ST7565 library and do a quick demo on Explore M3. The library can be used to display text, draw font, shapes etc. The speed and RAM of Explore M3 can be used to do some cool animations, which may look at in another tutorial. So lets get started.
Hookup
We had a custom breakout board for a Character On Glass(COG) display using used the ST7565 controller, you may find a lot of other Liquid Crystal Displays with the same controller, basically you need to hookup the following pins depending on the display that you've.
- pin 29 - Serial data out (SID)
- pin 28 - Serial clock out (SCLK)
- pin 27 - Data/Command select (RS or A0)
- pin 26 - LCD reset (RST)
- pin 25 - LCD chip select (CS)
Code
#include "ST7565.h" | |
// the LCD backlight is connected up to a pin so you can turn it on & off | |
#define BACKLIGHT_LED 10 | |
// pin 29 - Serial data out (SID) | |
// pin 28 - Serial clock out (SCLK) | |
// pin 27 - Data/Command select (RS or A0) | |
// pin 26 - LCD reset (RST) | |
// pin 25 - LCD chip select (CS) | |
ST7565 glcd(29, 28, 27, 26, 25); | |
unsigned char exploreM3 [] ={ | |
0x00, 0x00, 0x00, 0xF8, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFC, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x80, 0xF8, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0xF8, 0x80, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x38, 0x1C, 0x0C, 0x0C, 0x0C, 0x1C, 0xF8, 0xF0, 0x00, | |
0x00, 0x00, 0x00, 0xFF, 0xFF, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x01, | |
0x03, 0x8F, 0xDC, 0xF8, 0xF8, 0xDC, 0x8F, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x0C, | |
0x06, 0x03, 0x03, 0x03, 0x03, 0x06, 0x0E, 0xFC, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, | |
0x00, 0xF0, 0xFC, 0x0E, 0x06, 0x03, 0x03, 0x03, 0x03, 0x06, 0x0E, 0xFC, 0xF0, 0x00, 0x00, 0x00, | |
0xFF, 0xFF, 0x04, 0x02, 0x03, 0x03, 0x00, 0x00, 0xF0, 0xFC, 0x6E, 0x66, 0x63, 0x63, 0x63, 0x63, | |
0x66, 0x6E, 0x7C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, | |
0xF8, 0x3F, 0x07, 0x01, 0x07, 0x3E, 0xF0, 0xC0, 0x00, 0xC0, 0xF0, 0x1C, 0x07, 0x01, 0x07, 0x7F, | |
0xF8, 0xC0, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0F, 0x1D, 0xFC, 0x00, | |
0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x0C, | |
0x0E, 0x03, 0x01, 0x00, 0x00, 0x01, 0x03, 0x0E, 0x0C, 0x08, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x03, | |
0x06, 0x0C, 0x0C, 0x0C, 0x0C, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, | |
0x00, 0x00, 0x03, 0x07, 0x06, 0x0C, 0x0C, 0x0C, 0x0C, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, | |
0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x06, 0x0C, 0x0C, 0x0C, 0x0C, | |
0x0C, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0F, | |
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x03, 0x0F, 0x0C, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0E, 0x0C, 0x0C, 0x0C, 0x0E, 0x07, 0x03, 0x00, | |
0x00, 0x40, 0xC0, 0x40, 0x40, 0xC0, 0x40, 0x00, 0xC0, 0x40, 0x40, 0xD0, 0x00, 0x40, 0xF0, 0x40, | |
0x40, 0x04, 0xFC, 0x80, 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x89, 0xB1, 0xC0, | |
0x00, 0x00, 0x40, 0xC0, 0x80, 0x40, 0x40, 0x00, 0x80, 0x40, 0x84, 0xFC, 0x00, 0x40, 0xC0, 0x00, | |
0x00, 0xC0, 0x00, 0x40, 0xD0, 0x00, 0x40, 0xC0, 0x80, 0x40, 0xC0, 0x00, 0x00, 0x80, 0x40, 0x40, | |
0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0xC0, 0x00, 0x40, 0xC0, 0x80, 0x40, 0xC0, 0x00, | |
0x00, 0x80, 0x40, 0x84, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFC, 0x40, 0x40, 0x80, 0x00, 0x00, | |
0x80, 0x40, 0x40, 0x80, 0x00, 0x40, 0xC0, 0x40, 0x00, 0xC0, 0x40, 0x00, 0x80, 0x40, 0x40, 0x80, | |
0x00, 0x40, 0xC0, 0x80, 0x40, 0xC0, 0x00, 0x00, 0x80, 0x40, 0x84, 0xFC, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x03, 0x07, 0x00, 0x03, 0x06, 0x01, 0x00, 0x04, 0x07, 0x04, 0x00, 0x07, 0x04, | |
0x04, 0x04, 0x07, 0x04, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x04, 0x07, 0x04, 0x00, 0x00, 0x05, | |
0x06, 0x04, 0x04, 0x07, 0x04, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x07, 0x04, 0x00, 0x07, 0x04, | |
0x04, 0x07, 0x04, 0x04, 0x07, 0x04, 0x04, 0x07, 0x04, 0x00, 0x07, 0x04, 0x00, 0x03, 0x04, 0x04, | |
0x03, 0x00, 0x00, 0x00, 0x00, 0x06, 0x05, 0x05, 0x07, 0x04, 0x04, 0x07, 0x04, 0x00, 0x07, 0x04, | |
0x00, 0x03, 0x04, 0x04, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x03, 0x00, 0x00, | |
0x03, 0x05, 0x05, 0x05, 0x00, 0x40, 0x40, 0x33, 0x0E, 0x01, 0x00, 0x00, 0x03, 0x04, 0x04, 0x03, | |
0x00, 0x04, 0x07, 0x04, 0x00, 0x07, 0x04, 0x00, 0x03, 0x04, 0x04, 0x07, 0x04, 0x00, 0x04, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x42, 0x84, 0x00, 0x02, 0x02, 0x02, 0xFE, 0x02, | |
0x02, 0x02, 0x02, 0x02, 0x02, 0xC2, 0x22, 0x1A, 0x06, 0x02, 0x00, 0x00, 0x00, 0x30, 0x1E, 0x12, | |
0x12, 0x22, 0xC2, 0x00, 0x00, 0xC0, 0x30, 0x18, 0x14, 0x12, 0x20, 0xC0, 0x00, 0x00, 0x00, 0x30, | |
0x1E, 0x12, 0x12, 0x22, 0xC2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0C, 0x04, 0x02, 0x02, | |
0x02, 0x42, 0x44, 0x4C, 0xC0, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0C, 0x04, | |
0x02, 0x02, 0x02, 0x02, 0x04, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x02, 0x02, 0x04, 0x0C, 0xF0, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, | |
0x00, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, | |
0x04, 0x02, 0x01, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x01, 0x02, | |
0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x04, 0x04, | |
0x04, 0x04, 0x02, 0x03, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x03, 0x02, | |
0x04, 0x04, 0x04, 0x04, 0x02, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x02, 0x03, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
}; | |
// The setup() method runs once, when the sketch starts | |
void setup() { | |
Serial.begin(9600); | |
// turn on backlight | |
pinMode(BACKLIGHT_LED, OUTPUT); | |
digitalWrite(BACKLIGHT_LED, HIGH); | |
// initialize and set the contrast to 0x18 | |
glcd.begin(0x18); | |
glcd.drawbitmap(0,0,exploreM3,128,64,BLACK); | |
glcd.display(); | |
} | |
void loop() | |
{ | |
} | |
Demo
The big array that you see in the code is the bitmap. You may use software like LCD Assistant to convert images into bitmaps.

Explore M3 Introduction
Explore M3 is a feature rich ARM Cortex M3 development board. It can help you prototype ideas faster with Arduino/mbed and take them be beyond with bare metal programming, RTOS support and lower power...

Arduino Setup for Explore M3
In this tutorial we will look at the basic setups of setting up the ExploreM3 on Arduino and installing DFU and Vcom drivers on Windows, Linux and MAC. Finally we will flash a simple led-blink example...

Led Blink with Explore M3
Blinking an LED is fun for a newbie, a setup test for a Embedded Developer and for this tutorial it getting started with Explore M3 and answering some basic questions like, where did it come from...

Explore M3 Arduino Libraries
Arduino libraries need no introduction. There are numerous devices and peripherals that work with Arduino. This page lists all the libraries that have been tested or ported to Explore M3. ...