While there is much info out in the Ether on how to use a PCD8544 display using C++ (Arduino, etc.), not much can be found on Lua.
What we want to achieveUse a display with PCD8544 CMOS LCD controller/driver - e.g. Nokia 5110 LED Display - with a NodeMCU ESP826-compatible development board and Lua.
Requirements- NodeMCU ESP8266 compatible development board
- Display with PCD8544 controller - e.g. Nokia 5110
- nodeMCU firmware with the following modules included: gpio, i2c, spi, u8g2, uart
- u8g2 configuration - ensure you include your fonts. For the example here we will need the 6x10_tf and 5x8_tf font
For simplicity, you can download a suitable firmware here.
The firmware was created using the online service nodemcu-build.com
Restrictions- This tip is focused on Lua and ESP8266
- The pin connections are guaranteed to work with our Nokia 5110 displays. Other similar displays might have a different pin layout and you will need to adapt to your specific module.
- The tip uses SPI, hence there might be conflicts if you are using other SPI modules.
The u8g2 module only supports the PCD8544 controller via SPI. This means we will have to use the HMOSI and HSCLK GPIOs on the development board. For the connections, you are welcome to change the pin layout to suit your project needs.
Wiring PCD8544/LED -> ESP8266
Pin 1 - RST -> D0/GPIO16
Pin 2 - CE (CS) -> D8/GPIO15 - pull down with 10k resistor to GND
Pin 3 - DC -> D4/GPIO2
Pin 4 - DIN -> D7/HMOSI (fixed - you can't use a different pin)
Pin 5 - CLK -> D5/HSCLK (fixed - you can't use a different pin)
Pin 6 - VCC -> 3.3V - either from Development board or other sources
Pin 7 - BL .... Not used in this example
Pin 8 - GND -> GND - either from Development board or another source.
Comments
Please log in or sign up to comment.