Working with STM32 and display: Nokia 5110 Graphic LCD

In this guide, we shall interface Nokia 5110 graphic LCD with STM32.

In this guide, we will cover the following :

  • Nokia 5110 graphic LCD
  • LCD connection with STM32
  • Code
  • Demo

1.1 Nokia 5110 Graphic LCD:

Remember the days when cell phones were still “dumb,” and they had physical keypads and just a tiny monochrome LCD for a display? Now that iPhones, Galaxies, and the like have revolutionized that market, those little LCDs have to find a new purpose in life: adding customized graphical displays to projects!

Nokia5110 LCD screen is a simple black and white screen but it was the best display for mobile in its time. The usage of the screen was mostly in the Nokia 3310 and 5110. Therefore, the increase of color graphics and smart screens the screen is now the only available in most of the developing projects and small low budget devices. In the LCD, the Liquid crystal method helps to show the output data with a total of 84×48 pixels. The LCD uses the SPI pins to communicate.

1.2 What is Nokia5510 LCD Display?

Nokia 5510 LCD display is a graphics screen LCD display and has been used for a lot of applications. Initially, it was designed only for iconic Nokia 5510 cell phone screen but now we can easily use it for different purposes such as for displaying alphanumeric character, draw lines, shapes and even for displaying bitmap images because of its 84*48 monochrome pixels mean 84 columns and 48 rows. All necessary functions of this display are packed in a single small chip which is operated at very low voltages. It is very low cost more precise, more reliable and easy to use LCD display.

1.3 Nokia5110 Pinout Diagram

The pin configuration of the LCD is almost SPI but in oneway only. The LCD only uses a one-way communication to operate because it doesn’t have to send any data to the microcontroller. However, it has two modes of data and command modes for operating properly.

Nokia5110 LCD Pinout diagram details

1.3 Nokia5510 Pinout Diagram Details

PINSDETAIL
Pin6Power (VCC)The power pin will power up the LCD with external voltage to activate it.
Pin7Back Light (BL)The backlight is the internal color of the LCD. It is just turn on by giving the power input to its pin.
Pin8Ground (GND)The ground is internally common with LED and whole LCD. It helps to make common ground with external power and devices.

1.4 SPI Communication Pins

PINSDETAIL
Pin1ResetThe reset pins are to reset the Nokia5110 display. Here it will help in the programming library to reset it.
Pin2Chip Enable (CE)The enable pin in SPI helps to select the device in case of multiple devices. Here it will active the LCD with the LOW input signal.
Pin3Data/Command (DC)Pin3 helps to switch between the command/data mode. The HIGH signal is for data and LOW signal for command.
Pin4Serial IN (DIN)The “serial in” pin will send the data from the microcontroller/Arduino to the LCD Nokia5110.
Pin5Clock (CLK)The LCD and microcontroller will require a common clock to operate because of their SPI communication. CLK pin will help to make it.

1.5 Nokia5110 Features

  • The LCD is of 84×48 pixels combination, which are useable with any microcontroller.
  • The SPI communication helps to communicate with LCD, which is common in every microcontroller.
  • It is available in multiple backlights.
  • The PCD8544 LCD driver helps to drive it, which is already present on it.
  • Bitmaps images are viewable on the Nokia5110.

1.6 Nokia5110 LCD Applications

  • Most of the pocket games use the LCD, like snake games, etc.
  • Mobile phones have a wide use of LCD.
  • The LCD is still in most of the industrial and commercial applications.

1.7 Nokia5110 LCD Constructions

The Nokia5110 LCD uses a simple liquid crystal method for each pixel to show the data. In the liquid crystal, the three layers help to make a single pixel. The first layer is the glass, second is the polarized sheet and the third one is the crystal molecules. The light passes from one glass towards the other glass but it has to move from two polarized sheets. The polarized sheets are at different angles. So, to pass the light the molecules need to change their positions so the light gets a change in angle according to the second sheet with the help of modules. If light passes from it, then it is viewable by the user but in case of deflection, the LCD will show a dark pixel. However, the liquid crystals always use a light absorption method to show the image.

LCD Driver

The Nokia5110 LCD uses SPI communication to operate. It is due to the driver attached to it. The data from the controllers pass to the driver which store in the buffer and also show on the LCD until it is in the buffer. The new incoming data will able to replace the previous one. The driver only takes the SPI input signal and uses the rest of the pin to operate the LCD. The driver is PCD8544, which is only for 48×84 pixels LCD. Its functionality is viewable by the following block diagram:

block diagram

The driver has its 504bytes GDD RAM. However, Its memory comes with 6 blanks and each blank has 84 segments and each segment can store the 8 bit of data. Therefore, the whole LCD data can store in the GDD RAM of the LCD screen.

Output Pins

The input pins of the driver are the same as the LCD pins which are already in the pin configuration section.  The output pins of the driver are responsible for every function on the LCD screen. However, four types of output pins exist in the driver. The first part is the Row and Column pins. The row pins are 48 and columns are 84 in numbers. Therefore, all these pins connect to each pixel of the LCD and they are responsible for each output by them. The next part is the power part. The VSS, VDD, and VLCD help to power up the LCD and itself. The third part is the test pins that connect with the ground. In the Nokia5110 LCD, they have no use.

The last part is the oscillator pin, to attach an external oscillator. There will be remaining dummy pins that have no use in the LCD screen. In this Nokia5110 LCD, every kind of symbol is drawable. Even images can also show on the screen but first, it requires to convert into the bitmap format.

Working Principle of Nokia 5510 LCD Display

The word LCD stands for liquid crystal display. Its name describes that every LCD display consists of liquid crystal. When an electric current is passed through these crystals then the magnetic field is produced. This magnetic field-aligned the molecules of liquid crystal forcefully, then when they are aligned precisely then they allow the light to pass through these crystals.

The working phenomena of every LCD display are almost the same. But the voltages which are required to produce the magnetic field are different. On the biases of these voltages, the LCD display shows data which is coming from any type of controller. Two types of data have come from the controller’s fist one is word data and second one graphic data. Each data produces a different magnetic field and the LCD display shows this data according to its magnetic field.

2. Connection with STM32:

3. Coding:

We start off by creating new source and header file with name of nokia5110

In the header file

C

for the source file

C

You may download the project from here:

4. Demo:

Happy coding 🙂

1 Comment

  • B_KH Posted March 1, 2025 6:29 pm

    It’s very useful.

Add Comment

Leave a Reply to B_KH Cancel reply

Your email address will not be published. Required fields are marked *