Nokia5110 LCD
I have a Nokia 5110 LCD that I bought a long time ago and it has been gathering dust in the cardboard box. Maybe it was given as a gift when I bought other accessories? It has been left there without any suitable use. Occasionally, when I see it, I always think about it when I have time.
This is what it looks like. In fact, there are several different versions of this module on the market. Another version has two rows of pins on the top and bottom to facilitate different PCB layouts, but the functions are the same.
Monochrome LCD, 84x48 pixels, with 4 blue LEDs as backlight. Display chip is Philips PCD8544.
Because it is the display screen of Nokia5110 mobile phone, it is generally called Nokia5110 LCD. In 2014, when large-screen mobile phones were not popular, this was a very good display output device. Compared with 1602 and 2004 LCD, it was small in size, high in resolution, cheap and sufficient in quantity.
Now there are 12864 LCD/OLED everywhere, and there are also color LCDs with higher resolutions to choose from, so few people use this module anymore.
PCD8544
Philips produces a single-chip low-power CMOS LCD driver controller chip, used to drive an 84x48 pixel LCD
Interface is SPI
Display memory = 6 banks x 84 segments x 8 bits = 4032 bits = 504 bytes
Each bank contains 84 columns/segments (from 0 to 83)
Each column can store 8 bits of data (from 0 to 7)
Pin
RST Reset
CE Chip Select, CS
DC Data/Command Select, D/C
DIN SPI data, MOSI
CLK SPI clock line
VCC power supply, this module is compatible with 3.3V and 5V, if there is no mark, it is recommended to use 3.3V
BL Backlight
GND Ground
Instruction Description
PCD8544 has very few instructions, even fewer than ST7567. The display mechanism is basically the same as ST7567.
Write data and write commands
Use D/C pin control, high level indicates write data, low level indicates write command
Function settings
Function set: 0x20, superimpose the following parameters
Power down control: 0x04 Power down mode
Entry mode: 0x02 addressing mode, after setting, it becomes vertical addressing, first down and then right; normal mode is first right and then down, generally use normal mode
Extended instruction set: Enable extended instructions. After enabling, you can modify temperature parameters, voltage reference offset, display voltage, and the last two are used to adjust the contrast of the LCD.
Display Control
Display control: 0x08, superimpose the following parameters
Display blank Display blank: 0x00
Normal mode Normal display: 0x04
All display segments on Display all: 0x01
Inverse video mode: 0x05
Coordinate positioning
Display structure of PCD8544
It can only locate to the byte, and write data after locating, and it will write down according to the set addressing mode
Set x coordinate: 0x80 superimposes values between [0x00, 0x84)
Set the y coordinate: 0x40 superimposes values between [0x00, 0x06)
Extension instructions
The following commands must be executed after enabling extended instructions to be effective
Temperature control Temperature factor, 0x04 Superposition value [0x00, 0x03]
Bias system voltage reference control, 0x10 superimposed value [0x00, 0x07]
Set Vop Display voltage control, 0x80 superimposed value [0x00, 0x7F]
These three instructions need to be explained. Improper settings may result in a completely black display or no display at all.
The temperature factor can be left unset, and the default value is used.
The larger the voltage reference is set, the higher the actual display voltage will be, and the darker the LCD display will be. If the screen does not display, you can try to adjust it to 0x07.
The displayed voltage is proportional to the set value. The higher the value, the higher the actual displayed voltage, and the darker the LCD display part.
Tested with STC8H
The following tests are performed using STC8H3K32 and FwLib_STC8
wiring
Before powering on, be sure to check whether VCC and GND are correct and whether the voltage is correct.
P37 -> RES, RESET
P36 -> DC, A0
P35 -> CE, Chip Select
P32 -> SCK, SCL, CLK, Clock
P12 -> BL, Backlight
P34 -> MOSI, Din
GND -> GND
3.3V -> VCC
Code
The code can be downloaded from GitHub or Gitee
GitHub: FwLib_STC8/tree/master/demo/spi/pcd8544_nokia5110_lcd
Gitee: FwLib_STC8/tree/master/demo/spi/pcd8544_nokia5110_lcd
initialization
// Reset
PCD8544_Reset();
// Set the contrast. If the display is too light or too dark, you need to adjust it yourself
PCD8544_SetContrast(0x06, 0x20);
// Set to normal display mode
PCD8544_SetDisplayNormal();
Turning the backlight on and off
// Turn on the backlight
PCD8544_SetBackLightState(HAL_State_ON);
// Turn off the backlight
PCD8544_SetBackLightState(HAL_State_OFF);
Qingping
PCD8544_Fill(0);
PCD8544_UpdateScreen();
Reverse
After turning on reverse display, you need to set it back to normal display mode to restore it. You cannot restore it by calling reverse display again.
PCD8544_SetDisplayInverted();
Line drawing
// Draw a line from (0,0) to (83,0)
PCD8544_DrawLine(0, 0, 83, 0, 1);
PCD8544_DrawLine(0, 0, 0, 47, 1);
PCD8544_DrawLine(83, 0, 83, 47, 1);
PCD8544_DrawLine(0, 47, 83, 47, 1);
PCD8544_UpdateScreen();
Display text
// Move the coordinates to (3,3)
PCD8544_GotoXY(3, 3);
// Use 5x7 font to display English
PCD8544_Puts("LCD:PCD8544", &Font_5x7, 1);
PCD8544_UpdateScreen();
Shutdown Mode
// Shutdown
PCD8544_SetPowerDownMode(HAL_State_ON);
// Power on
PCD8544_SetPowerDownMode(HAL_State_OFF);
Parameter Description
These three extended commands will affect the display. Improper settings will cause the display to be completely white or completely black.
#define PCD8544_SETTEMP 0x04 // Extended instruction set - Set temperature coefficient
#define PCD8544_SETBIAS 0x10 // Extended instruction set - Set bias system
#define PCD8544_SETVOP 0x80 // Extended instruction set - Write Vop to register
in
PCD8544_SETTEMP is the temperature factor, usually no need to set
PCD8544_SETBIAS is the bias level, usually set to a value between [3,7], the corresponding write is [0x13, 0x17]
PCD8544_SETVOP is the system voltage, which will be affected by the above two parameters
If there is no display or the display is completely black after initialization, you can adjust it according to the above range.
Demo
The video shows the contrast changes caused by adjusting the display voltage under different reference voltages.
https://www.bilibili.com/video/BV1eF411G7Y7
reference
https://github.com/adafruit/Adafruit-PCD8544-Nokia-5110-LCD-library
https://lastminuteengineers.com/nokia-5110-lcd-arduino-tutorial/
Use Arduino UNO to drive Nokia5110 LCD https://www.youtube.com/watch?v=VtZvf5T98FI
Previous article:STC8H Development (XI): GPIO single line driving multiple DS18B20 digital thermometers
Next article:Qinheng CH32V103C8T6 Development Environment Notes
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- ARM's strategic layout in the field of Internet of Things
- BearPi-HM Nano Development Board Review 1 Getting Started with Program Development
- 【GD32307E-START】Unboxing + Impressions of the board + Lighting ceremony
- Sequential logic circuit
- I have some doubts about SensorTile.box
- A novice needs help. When drawing PCB manual wiring in AD13.4, why can't I see the trace of the wiring before the wiring is completed?
- What are the important techniques for PCB wiring?
- Naming of Cadence Allegro 17.2 built-in pads
- Video: Talking about TI CC2650
- How stable is RT-Thread?