PCD8544 LCD driver (Nokia 5110)
This is a monochome LCD display driver typically used in the Nokia 5110 LCD display (84x48), but also the 5120, 5130, 5160, 6110, 6150, 3210, 3310, 3315, 3330, 3350, 3410 and 6210. The LCDs are available (pre-mounted on PCBs) cheaply from via various suppliers online.
They draw very small amounts of power - around 200uA - making them extremely good for use in battery powered devices.
Support is included in the PCD8544 (About Modules) module, using the Graphics library.
Just wire up as follows:
LCD pin | Pin type | Example pin on Espruino Board |
---|---|---|
GND | GND | GND |
LIGHT | Any | GND (backlight on) |
VCC | 3.3v | 3.3 |
CLK | SPI SCK | B3 |
DIN | SPI MOSI | B5 |
DC | Any | B6 |
CE | Any | B7 |
RST | Any | B8 |
SPI1.setup({ sck:B3, mosi:B5 });
var g = require("PCD8544").connect(SPI1, B6 /*DC*/, B7 /*CE*/, B8 /*RST*/, function() {
g.clear();
g.drawString("Hello",0,0);
g.drawLine(0,10,84,10);
g.flip();
});
Note:
- The display needs initialising each time the power is applied - so if you're planning on saving your code, put
.connect
in theonInit()
function. - The display takes around 100ms to initialise after calling 'connect'. There's an optional callback that is called after this time (shown in the example). Sending data to it before initialisation may cause it not to initialise correctly.
- This module uses a double buffer, which means you need to call
g.flip()
before any changes take effect. - The display seems picky about lower SPI baud rates - try and keep above 1Mhz in
SPI.setup
- You can use
g.setContrast(0.45)
to set the contrast of the LCD display. It takes a value between0
and1
-0.5
is the default.
Using
















Buying
This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.