stm32 nucleo lcd display free sample

In this tutorial, we’ll discuss the alphanumeric LCD 16×2 interfacing with STM32 microcontrollers. Starting with an introduction to the LCD 16×2 display, then how to implement a driver for it on STM32 blue pill board. We’ll set up all the configuration parameters and get our first ECUAL layer driver done, so we can make our next applications more portable. This will be detailed by the end of this tutorial and in the next one, so let’s now get started!

We typically add a 16×2 Alphanumeric LCD to small embedded systems & projects to enhance the user experience and UI of the device/project. You can use it to display text messages to the user, number, etc. Other types of LCDs provide different features such as the number of columns and rows (characters) and maybe colored display, and also different interfaces (parallel, spi, i2c, etc).

For this tutorial, we’ll consider the 16×2 LCD with a 16-pin header interface. Assuming it has the standard Hitachi LCD driver HD44780 controller. The Alphanumeric LCD 16×2 Tutorial did highlight everything you need to know. That’s why I highly recommend that you check it out right now. In order to know, the internals of the LCD driver IC, it’s registers, commands, and how it works and gets initialized, etc.

Today’s tutorial is built upon the previous LCD one, and it’s assumed that you’ve got a basic understanding of the topics discussed earlier. We’ll port the LCD driver in 4-Bit mode to make it easily configurable and portable across most STM32 microcontroller devices.

The best way in my opinion for interfacing alphanumeric LCD screens is using an external I2C LCD driver chip. In this way, you save up a lot of valuable GPIO pins for other uses and it only requires 2 wires on the I2C bus. However, it’s going to be a topic for a future tutorial as we didn’t cover the I2C in STM32 MCUs yet.

Therefore, in this tutorial, we’ll be interfacing the LCD 16×2 display in the 4-bit mode which requires 6 GPIO pins. And as you know the STM32 microcontroller is a 3.3v logic device and the LCD is 5v. But it is not a big deal, as the STM32 output (3.3v) pins will be correctly detected by the LCD (5v) input pins. And the only 5v line that is required is the LCD VDD, and you can supply it from the blue pill board 5v pin.

Don’t also forget to connect the contrast control potentiometer as indicated in the diagram shown above. Low contrast may seem to you like a not-working-LCD and hence unnecessarily waste so much time debugging a code that actually works!

After flashing the code to your microcontroller, the LCD may not work from the USB programmer set up. It’s recommended to un-plug the programmer and use external power supply or USB power bank. The LCD may not work at all from the laptop USB or in some cases misbehave, so stay safe with an external power source.

The STM32 microcontroller has to first initialize the LCD display before it can actually send any characters to be displayed correctly. The initialization procedure is step-by-step indicated in the LCD driver datasheet for both modes 4-bit and 8-bit. And it requires a few delay instructions, so I’ll be using the DWT delay which we’ve developed in the previous tutorial.

The available instructions that the LCD driver IC can execute are listed in the datasheet. As well as the execution time for each instruction. Therefore, you should be careful at this time! you can use an extra pin to read the busy flag bit from the LCD to know whether it did execute the last instruction or not. Otherwise, it’s mandatory to use time delays according to the datasheet specs. Here is a list of the LCD instructions.

I’ve received a lot of questions and suggestions from you since the last LCD tutorial that I’ve published. The conclusion that I’ve settled for is that maybe there are various versions of the LCD modules and drivers ICs that can be the direct reason why the signal’s timing differs from a user to another.

Here I’m speaking about the enable pulse that you should send to the LCD driver after each command in order to transfer the 8-bit CMD word (whether at once or at 2 stages in 4bit mode).

The datasheet says it should be no less than 200nSec. However, an old LCD with me didn’t receive any data until this pulse delay was up to 500uSec (which is so long in fact). Another LCD could work just fine with 50uSec pulses but no less than that. Another one with a different color did work absolutely fine with a 1uSec pulse. Which is pretty reasonable amount of delay.

The LCD 16×2 driver is going to be our first ECUAL (ECU Abstraction Layer), driver. This software layer is added to abstract the hardware dependencies from the application layer. All the onboard ECU peripherals, sensors, memory, and so on do depend on the MCU peripherals and their HAL drivers. The procedure followed by calling some HAL drivers and doing some initialization and calculations work will also get abstracted from the application by introducing the ECUAL layer.

The software component (LCD Driver) in the ECUAL layer will call some HAL_GPIO pin manipulation functions, DWT_Delays, and other HAL & utilities. So that the application code can be more portable, and you can easily change the platform (microcontroller) and have your application running with a high level of portability. And you’ll also have configuration files in each driver to add further adjustability to our software.

The first step is to create the source code directory for the ECUAL layer in which we’ll also create the first driver directory called LCD16x2, and finally create the following 4 files.

The purpose of having these files in our driver is to make it easily configurable by the user (the application programmer). We shall put all the important parameters in there in a structure that encapsulates all the config parameters together. I’ve chosen to put in there the LCD GPIO pins, GPIO port, and the enable pulse width time.

This means that my driver in this way of implementation assumes that the user will hook the LCD pins to the sam MCU port whatever the pin numbers are. But you can actually make it even more portable so that the user can use pins from multiple GPIO ports! but the config structure will be a bit larger and it’s not a big deal however, it’s a design decision that I’ve made and preferred to tell you that I did that for simplicity’s sake and can be adjusted by you if it’s really needed.

Note that the configuration parameter structure is externed to the header file so that in the LCD16x2.c source code we can include the configuration header file LCD16x2_cfg.h and see that global config parameter and do our pin manipulations on these defined ones. This type of configuration is called linking configuration, as it gets resolved during the compilation time in the linking stage and the user (the programmer) doesn’t have to compile the whole project in order to change the configurations, only compile the configuration source and link it with your application object files. This topic and other types of configurations will be discussed in the next tutorial as well.

It is a bit long file 150 lines of code, and it’s found in the download link down below as well as the other files. The thing you need to know about this source code file is that it’s an implementation for all the declared functions in the header file above to initialize the LCD, write char, string, and all other stuff. It’s a direct implementation for what is documented in the LCD datasheet and we’ve previously done it in This LCD tutorial. So it should be easily ported to the STM32 ecosystem.

In this LAB, our goal is to build a system that initializes the LCD driver. Which in turn initialized the configuration-defined GPIO pins and therefore send the initialization commands to the LCD as described in its datasheet. After this, we can easily call the LCD driver functions to set the cursor position, print strings, and shift the entire display on the LCD right and left. It’s a very basic and simple LAB.

stm32 nucleo lcd display free sample

Worldwide,Asia,Europe,Africa,North America,South America,Oceania,Afghanistan,Bahrain,Bangladesh,Bhutan,Brunei,Burma (Myanmar),Cambodia,China,East Timor,India,Indonesia,Iraq,Japan,Jordan,Kazakhstan,Kuwait,Kyrgyzstan,Laos,Malaysia,Maldives,Mongolia,Nepal,Oman,Pakistan,Philippines,Qatar,Russian Federation,Saudi Arabia,Singapore,South Korea,Sri Lanka,Taiwan,Tajikistan,Thailand,Turkmenistan,United Arab Emirates,Uzbekistan,Vietnam,Yemen,Albania,Andorra,Armenia,Austria,Azerbaijan,Belarus,Belgium,Bosnia and Herzegovina,Bulgaria,Croatia,Cyprus,Czech Republic,Denmark,Estonia,Finland,France,Georgia,Germany,Greece,Hungary,Iceland,Ireland,Israel,Italy,Latvia,Liechtenstein,Lithuania,Luxembourg,Macedonia,Malta,Moldova,Monaco,Montenegro,Netherlands,Norway,Poland,Portugal,Romania,San Marino,Serbia,Slovakia,Slovenia,Spain,Sweden,Switzerland,Turkey,Ukraine,United Kingdom,Vatican City,Algeria,Angola,Benin,Botswana,Burkina,Burundi,Cameroon,Cape Verde,Central African Republic,Chad,Comoros,Democratic Republic of Congo,Djibouti,Egypt,Equatorial Guinea,Eritrea,Ethiopia,Gabon,Gambia,Ghana,Guinea,Guinea-Bissau,Ivory Coast,Kenya,Lesotho,Liberia,Libya,Madagascar,Malawi,Mali,Mauritania,Mauritius,Morocco,Mozambique,Namibia,Niger,Nigeria,Rwanda,Sao Tome and Principe,Senegal,Seychelles,Sierra Leone,Somalia,South Africa,Swaziland,Tanzania,Togo,Tunisia,Uganda,Zambia,Zimbabwe,Antigua and Barbuda,Bahamas,Barbados,Belize,Canada,Costa Rica,Dominica,Dominican Republic,El Salvador,Grenada,Guatemala,Haiti,Honduras,Jamaica,Mexico,Nicaragua,Panama,Saint Kitts and Nevis,Saint Lucia,Saint Vincent and the Grenadines,Trinidad and Tobago,United States,Argentina,Bolivia,Brazil,Chile,Colombia,Ecuador,Guyana,Paraguay,Peru,Suriname,Uruguay,Venezuela,Australia,Fiji,Kiribati,Marshall Islands,Micronesia,Nauru,New Zealand,Palau,Papua New Guinea,Samoa,Solomon Islands,Tonga,Tuvalu,Vanuatu Active TouchGFX advanced and free of charge graphical framework optimized for STM32 microcontrollers STM32Cube Expansion Packages ST X-CUBE-TOUCHGFX

stm32 nucleo lcd display free sample

The LCD I am using is a 2.8″ TFT LCD with SPI communication. I also have another 16-bit Parallel TFT LCD but it will be another story for another time. For this post, let’s focus on how to display what you want on the 2.8″ LCD. You can find all details about this LCD from this page:http://www.lcdwiki.com/2.8inch_SPI_Module_ILI9341_SKU:MSP2807

First thing first, this LCD use SPI as the main communication protocol with your MCU. For STM32 users, HAL Library has already implemented this protocol which makes this project easier for us. But, a little knowledge about this protocol does not hurt anyone. SPI is short for Serial Peripheral Interface which, aside from two data lines, also has a clock line and select lines to choose between devices you want to communicate with.

This LCD uses ILI9341 as a single-chip SOC driver for a display with a resolution of 240×320. More details can be found in the official document of ILI9341. But the most important thing is that we have to establish astart sequencein order for this LCD to work. The “start sequence” includes many other sequences which are also defined in the datasheet. Each sequence starts when you send a command to ILI9341 and then some parameters to follow up. This sequence is applied for all communication between MCU and ILI9341.

For this project, I recommend using theSystem Workbench for STM32for coding and building the code. After installing and open the program, go to the source code you have just downloaded and double click the.cprojectfile. It will automatically be open in your IDE. Then build the program by right click on the folder you just open (TFTLCD) and chooseBuild Project. Wait for it to finish and upload it to the board by right clicking the folder, choose Run As and then clickAc6 STM32C/C++ Application. And that’s it for running the example.

The most important library for this project is obviously the ILI9341_Driver. This driver is built from the provided source code in the lcdwiki.com page. I only choose the part that we need to use the most in many applications like writing string, displaying image and drawing symbols. Another library from the wiki page is the TOUCH library. Most of the libraries I got from the Internet were not working properly due to some adjustments to the original one.

To draw symbols or even display images, we need a “byte array” of that image or symbol. As an illustration, to display an image from a game called Transistor, I have a “byte array” of that image stored in a file named transistor.h. You can find this file in the link below. Then, I draw each pixel from the image to the LCD by adding the code in the Display_Picture() function in the Display folder.void Display_Picture()

The above example is just only for displaying black and white image. In order to show a color image, we need to a little bit different. First, go tothis websiteto generate the array of the colour image. Remember to change your size to 320×240 and choose the 65K color option. Because it now takes up two bytes for one pixel, we need to send two bytes at once. You can check the Display_Color_Picture() function in the Display folder.void Display_Color_Picture()

stm32 nucleo lcd display free sample

Hi Christian. Very glad to hear your display is working. This test was to confirm that your shield and LCD display are not damaged using the same working code as ours. The shield you own features a back light control and also push buttons that can be read using an analog to digital pin on your MBED. The shield features resistors configured as voltage dividers which vary depending on the pushbutton you press. Respectively, for each pushbutton press, the analog voltage will change and the MBED code will read this voltage to decipher which pushbutton you selected.

The back light feature is nice to have if you plan to use your display in a dark situation. We do not have this feature on our display. In the absence of the use of this pin, the circuit by default ENABLES your backlight control. So the code we are both using is not enabling nor disabling your backlight and also is not capable of reading the pushbutton values from your shield.

Now, I would recommend that you attempt to debug the original code now that you know your shield is working. Proceed as follows, be sure to use the proper pin mappings (as you have done). Is your MBED library up to date ? You can do this check by selecting the MBED label in your workspace for this project -> review the status of the library on the right side of your compiler screen. We just imported the Freetronics project and found that the supplied MBED library is old and needs to be updated. This is a simple UPDATE button selection. This update may very well fix this project to be compatible with the Nucleo STM32F072RB board. Keep in mind that MBED solutions are meant to be generic but sometimes the routines are not perfected for every hardware target board (ie. this LCD project uses a lot of required delays in the code to R/W or initialize the display for 4 bit mode, etc. - if the delays are not properly timed, the display will fail to operate). This is a key reason to be up to date on your MBED libraries. Other suggestions are to review the LCD routines, module at a time against the working code and also the LCD controller data sheet. I would consider to even replace the wait() routines with wait_ms(). Something simple is breaking the original code and most likely only because you selected a different target board as compared to the author of this LCD code. Wish you luck and have fun with your experiments while you learn more about MBED and LCDs ! Knowledge is truly priceless.

Update - just reviewed the working source code from MBED and that library is also using the working wait() routines. So that should not be the fault. I would focus on trying to compare how the LCD display is initialized against the 2 different code routines. Again, something minor is breaking the code. You should be able to nail the root cause after a bit of trial and error.

stm32 nucleo lcd display free sample

Today I am going to interface LCD to STM32 using an I2C device (PCF8574). PCF8574can be used as a port extender, to which LCD will be connected. If you haven’t read my previous post about I2C go check that out HERE.

Well you generally don’t but as I mentioned in my previous article that we can connect up to 128 devices on the same I2C line and let’s say we want to connect two different LCDs on the same I2C line, than we can’t use two PCF8574 with same addresses and we need to modify one of them.

As shown in the figure above, first pin of the device is Vsswhich is pin 1 of LCD. So all you have to do is connect first pins of the LCD to Vssabove and rest will connect accordingly. Starting with Vss as first pin, connection is as follows:-

As according to the datasheet of the LCD 16×2, in order to initialize the LCD, we have to use some sequence of commands. The code is commented properly, so that you can understand it better

stm32 nucleo lcd display free sample

The aim of this Bluetooth LE project is to read air quality sensor data and show it on an LCD display which is connected to STM32 board. A web browser will read the sensor data and pass it to STM32 board using BleuIO.

For this project, we will need two BleuIO USB dongles, one connected to the Nucleo board and the other to a computer running the web script and a HibouAir – Air quality monitoring device .

When the BleuIO Dongle is connected to the Nucleo boards USB port the STM32 will recognize it and directly start advertising. This allows the Dongle on the computer port connect with the web script.

With the web script on the computer, we can scan and get air quality sensor data from HibouAir. Then we send these data to LCD screen connected to STM32 using Bluetooth.

We have used a STM32 Nucleo-144 development board with STM32H743ZI MCU (STM32H743ZI micro mbed-Enabled Development Nucleo-144 series ARM® Cortex®-M7 MCU 32-Bit Embedded Evaluation Board) for this example. This development board has a USB host where we connect the BleuIO dongle.

A board with a STM32 Microcontroller with a USB port. (A Nucleo-144 development board: NUCLEO-H743ZI2, was used developing this example. (https://www.st.com/en/evaluation-tools/nucleo-h743zi.html)

Connect the BleuIO dongle to the computer. Run the web script to connect to the other BleuIO dongle on the STM32. Now you can send sensor data to the LCD screen.

Create a simple Html file called index.html which will serve as the frontend of the script. This Html file contains some buttons that help connect, read advertised data from the HibouAir to get air quality sensor data, and send this data to the LCD screen which is connected to stm32.

The script has a button to connect to COM port on the computer. There is a text field where you can write sensor ID of the air quality monitor device. Once connected, the script will try to get advertised data from the sensor and convert it to a meaningful data. After that it will send this data to the STM32 board which then display on the LCD screen.

stm32 nucleo lcd display free sample

This library is a professional graphical stack library, enabling the building up of Graphical User Interfaces (GUIs) with any STM32, any LCD/TFT display and any LCD/TFT controller, taking advantage of STM32 hardware accelerations whenever possible.

STemWin Library is a comprehensive solution coming with rich features such as JPG, GIF and PNG decoding, many widgets (checkboxes, buttons…) and a VNC server allowing to display remotely a local display, but also professional development tools such as GUIBuilder to create GUIS with simple drag and drop.

MCUs Embedded SoftwarePart NumberManufacturerDescriptionSTEmbedded software for STM32F0 series (HAL, Low-Layer APIs and CMSIS drivers, USB, File system, RTOS, Touch Sensing - coming with examples running on ST boards: STM32 Nucleo, Discovery kits and Evaluation boards)

STEmbedded software for STM32 F1 series (HAL low level drivers, USB, TCP/IP, File system, RTOS, Graphic - coming with examples running on ST boards: STM32 Nucleo, Discovery kits and Evaluation boards)

STEmbedded software for STM32 F2 series (HAL low level drivers, USB, TCP/IP, File system, RTOS, Graphic - coming with examples running on ST boards: STM32 Nucleo and Evaluation boards)

STEmbedded software for STM32 F3 series (HAL low level drivers, USB, File system, RTOS, Touch Sensing, Graphic - coming with examples running on ST boards: STM32 Nucleo, Discovery kits and Evaluation boards)

STEmbedded software for STM32F4 series (HAL low level drivers, USB, TCP/IP, File system, RTOS, Graphic - coming with examples running on ST boards: STM32 Nucleo, Discovery kits and Evaluation boards)

STEmbedded software for STM32 L1 series (HAL low level drivers, USB, File system, RTOS, Touch Sensing, Graphic - coming with examples running on ST boards: STM32 Nucleo, Discovery kits and Evaluation boards)

STEmbedded software for STM32L4 series (HAL, Low Layer APIs and CMSIS drivers, USB, TouchSensing, File system, RTOS, Graphic - coming with examples running on ST boards: STM32 Nucleo, Discovery kits and Evaluation boards)

stm32 nucleo lcd display free sample

Finally the totally new Nucleo-F746 is in my hands! This is the first development kit of the Nucleo-144 line from ST, and I"ve to say that probably, at that street price (~23$), is the best development kit a maker can find on the market, if you consider that a genuine Arduino DUE costs more than 40$ and its MCU is just a Cortex-M3.

Compared to the classic Nucleo-64, it looks impressive: it"s more wider and offers a lot of more "standard" peripherals. The USER LEDs are now three (red, blue and green), and the power LED is now green. The most relevant thing is that the board comes with a LAN jack, magnetics and a SMSC phyther. This means that we can start developing IoT applications using the powerful Cortex-M7 core running at 216MHz. Respect to the STM32F746-Discovery, which was the first "cheap" F7 development board from ST, it doesn"t provide an LCD display. However, the Nucleo-144 provides the most of MCU signal I/Os through the "Zio" connectors, while the Discovery-F7 only few signals routed to the Arduino-style connectors. If you are going to use the Nucleo-144 to develop a custom product, then it"s the best option.

In this post I will show you the steps needed to start working with this fantastic piece of hardware. We"ll use the LwIP stack to create a simple web server running on the Nucleo. The web-app will allow us to interact with Nucleo LEDs and USER BUTTON, using bootstrap and jQuery. The following video shows how the HTTP server works.

I"ll assume that you have a working Eclipse/GCC ARM tool-chain based on the excellent GNU ARM Eclipse plug-ins by Liviu Ionescu. If you don"t have the whole tool-chain installed, please refer to the free sample of my book about STM32 platform: you"ll find all the required instructions to getting started with those tools. It"s completely useless repeat here more that 40 pages of instructions.

My book currently relies on OpenOCD 0.9. However, this release doesn"t support the STM32F7, so you"ll need a preview of the release 0.10. Liviu provides a precompiled release for Windows, Linux and MacOS. You can download it from here.[/box]

The first step is creating a new Eclipse project. Liviu Ionescu has recently updated the project templates, adding the support to STM32F7 MCUs. However, we use another procedure here: we"ll first create a basic ARM C/C++ project, and then we"ll import inside it a project generated by CubeMX, which simplify a lot the MCU configuration procedure. Moreover, it will allow us to quickly import the LwIP stack, which is used to develop TCP/IP applications with STM32 MCUs.

Those numbers are nothing more than the size of FLASH and SRAM memories in a STM32F746 MCU. They are used to generate the right linker script, as we"ll see next. [/box]

Now, before we import a CubeMX project inside this Eclipse project, it"s better to modify the ldscripts/mem.ld file. By default, the GNU ARM plug-in assigns 0x00000000 as starting address for the FLASH memory, while in all STM32 MCUs the internal FLASH is mapped at 0x08000000. So, from the Eclipse IDE open the file ldscripts/mem.ld and write the first line of the MEMORY section as shown below:

Launch CubeMX and start a new project. In the New Project wizard select the Board Selector tab, and choose the Nucleo-F746ZG from the list. Be sure that the flag "Initialize all IP with their default mode" is checked. Click on OK and wait for project generation.

At the time of writing this post, January 22th, 2016, a bug affects CubeMX 4.12. This bug is related to the project configuration for this Nucleo, and I"ve already submitted it to ST. CubeMX simply assigns a wrong address to the Ethernet Phyther. To fix this, go inside the Configurationsection in CubeMX and click on the Eth button. In the PHY Address config, change the value from 1 to 0, as shown below.

The IP address must match your network configuration. Click on the OK button. Ok. Now we are ready to generate the project code. Go in the Project->Generate Code menu. Choose the Project Name you like (I chose nucleo-f7), but ensure that the Toolchain/IDE selected is the SW4STM32, as shown below.

For example, if you named the Eclipse project as stm32-nucleo144-f7 and the CubeMX as nucleo-f7, than the command must be invoked in the following way:

Click on the OK. Now we have to select the right FreeRTOS algorithm. In the Project Explorer view, go inside the Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang folder. Select the files heap_1.c, heap_2.c, heap_3.c and heap_5.c. Click with the right mouse button on them and select the entry Resource Configurations->Exclude from build.... Select all the project configurations and click on OK. Now we can compile the application and flash our Nucleo using OpenOCD (if you don"t know how to use OpenOCD with the F7 platform, refer to this other post).

Now we are ready to build a simple HTTP Server using the LwIP stack. The first important thing we have to do is to fix the body of theSysTick_Handler() inside the stm32f7_xx_it.c. A known CubeMX bug causes that the call to HAL_IncTick() function is omitted. So, we need to modify it in the following way:

and embedded inside the final firmware (the STM32F7 has sufficient FLASH space to store a whole HTML file in it). The web-app is reachable going to http:///index.html.

stm32 nucleo lcd display free sample

My main aim is to just display 1 character I have gone through datasheet and forums and have taken everyones"s suggestion accurately I still can"t figure out what"s wrong with my program..

stm32 nucleo lcd display free sample

In this tutorial, I will show you how to interface an I2C LCD with STM32F103C8T6 MCU based STM32 Blue Pill Board. If you remember the “Interfacing 16X2 LCD with STM32F103C8T6” tutorial, I have already show you how simple it is to connect the LCD with STM32 and display some information. This project will be interesting as I will make use of I2C Communication to communicate with 16×2 LCD.

Small Alpha-Numeric Character Displays like the very popular 16×2 LCD Display are very useful little components as you can use them to display some important information related to your project. The information displayed on the LCD can be related to the project itself like a reading from a Temperature Sensor or special data like debug messages or error codes.

I have used 16×2 LCD display module in quite a lot of my projects with a wide variety of Microcontrollers like 8051, ARM7 based LPC2148, ATmega8, Arduino UNO and PIC.

This is all well and good but a small problem with 16×2 LCD or even the larger 20×4 LCD Display is it takes a lot of pins for interfacing with Microcontroller. Even in 4-bit data mode, the LCD needs atleast 6 Pins of the Microcontroller (four for the Data Pins, one for Register Select pin and one for Enable Pin, assuming the operation is Write i.e. R/W is connected to GND).

Using six pins of the Microcontroller to connect to a character display seems not that important but if your project is quite complex, then every pin of the MCU seems very important.

Here comes the PCF8574 GPIO Expander IC to the rescue. It comes as a dedicated module for interfacing 16×2 LCD Display with all the bells and whistles i.e. 10KΩ POT for Contrast adjustment of LCD, Pull-up resistors for I2C Communication, I2C Pins for connecting with Microcontroller etc.

You can simply attach this module at the back of the 16×6 LCD Display and connect the I2C Pins to corresponding I2C Pins of the STM32 Blue Pill Board. It is that simple.

The other type of module is also based on the PCF8574 IC but it is designed in such a way that it can be used only with LCD Display i.e. 16×2 and even 20×4 LCDs. So, for this project, you have to choose the latter as it has all the necessary components and connections related to interfacing a 16X2 LCD Display.

The connections for this project are very simple. Just plug-in the PCF8574 Module to the back of the 16×2 LCD. Check the pins of both the LCD and the PCF8574 Module before connecting. If connected correctly, the I2C pins on the PCF8574 Module will be easily accessible at the right of the display.

Now, connect the SDA pin of the PCF8574 Module to PB7 of STM32 and connect the SCL pin of the module to PB6 of STM32. Connect the VCC and GND pins of the PCF8574 Module to 5V and GND. This completes the necessary connections.

Before programming STM32 for Interfacing I2C LCD Display, we need to calculate the slave address of the PCF8574 Module. Since, Slave Address in I2C Communication is very important, you have to know it beforehand.

You can calculate the slave address by referring to the data sheet of PCF8574 IC and also the schematic of the PCF8574 I2C LCD Module. If you think it is a tedious process, then do not worry. There is another way to calculate the slave address by using the following code. This code will calculate the Slave Address and display it on the Serial Monitor.

After interfacing I2C LCD with STM32F103C8T6 MCU, we are now ready to write the program. There is a special library called “LiquidCrystal_I2C” developed for this module. You can download this library from this link. Extract the contents of the downloaded zip fie and place them in the libraries folder of your local Arduino installation.

Use the slave address that we got from the previous code and initialize the LCD Module with the same. Also specify the number of characters per row and number of rows of the LCD i.e. 16 and 2.

stm32 nucleo lcd display free sample

STM32 is a family of 32-bit microcontroller integrated circuits by STMicroelectronics. The STM32 chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M33F, Cortex-M7F, Cortex-M4F, Cortex-M3, Cortex-M0+, or Cortex-M0. Internally, each microcontroller consists of the processor core, static RAM, flash memory, debugging interface, and various peripherals.

The STM32 is a family of microcontroller ICs based on the 32-bit RISC ARM Cortex-M33F, Cortex-M7F, Cortex-M4F, Cortex-M3, Cortex-M0+, and Cortex-M0 cores.STMicroelectronics licenses the ARM Processor IP from ARM Holdings. The ARM core designs have numerous configurable options, and ST chooses the individual configuration to use for each design. ST attaches its own peripherals to the core before converting the design into a silicon die. The following tables summarize the STM32 microcontroller families.

In November 2010, ST announced the STM32 F2-series chips based on the ARM Cortex-M3 core, and future development of chips based on the ARM Cortex-M4 and ARM Cortex-M3 cores.

In September 2012, ST announced full-production of STM32 F3-series chips and STM32F3DISCOVERY board. The STM32 F050-series will also be available in a TSSOP20 package.

In October 2018, ST announced the STM32L5 series, ultra-low-power MCUs based on the ARM Cortex-M33 core with a variety of security features, such as TrustZone, Secure Boot, active IO tamper detection, Secure Firmware Install loader, certified cryptolib etc.

In February 2021, ST announced the STM32U5 series, ultra-low-power MCUs based on the ARM Cortex-M33 core with a variety of low power and security features, such as TrustZone, Secure Boot, active IO tamper detection, hardware-based protection targeting PSA and SESIP assurance level 3, etc.

The STM32 family consists of 17 series of microcontrollers: H7, F7, F4, F3, F2, F1, F0, G4, G0, L5, L4, L4+ L1, L0, U5, WL, WB.Cortex-M7F, Cortex-M4F, Cortex-M33, Cortex-M3, Cortex-M0+, or Cortex-M0 ARM processor core. The Cortex-M4F is conceptually a Cortex-M3DSP and single-precision floating-point instructions.

The STM32 H7-series is a group of high performance STM32 microcontrollers based on the ARM Cortex-M7F core with double-precision floating point unit and optional second Cortex-M4F core with single-precision floating point. Cortex-M7F core can reach working frequency up to 480 MHz, while Cortex-M4F - up to 240 MHz. Each of these cores can work independently or as master/slave core.

The STM32H7 Series is the first series of STM32 microcontrollers in 40 nm process technology and the first series of ARM Cortex-M7-based microcontrollers which is able to run up to 480 MHz, allowing a performance boost versus previous series of Cortex-M microcontrollers, reaching new performance records of 1027 DMIPS and 2400 CoreMark.

The STM32 F7-series is a group of STM32 microcontrollers based on the ARM Cortex-M7F core. Many of the F7 series are pin-to-pin compatible with the STM32 F4-series.

The STM32 F4-series is the first group of STM32 microcontrollers based on the ARM Cortex-M4F core. The F4-series is also the first STM32 series to have DSP and floating-point instructions. The F4 is pin-to-pin compatible with the STM32 F2-series and adds higher clock speed, 64 KB CCM static RAM, full-duplex I²S, improved real-time clock, and faster ADCs. The summary for this series is:

The STM32 F3-series is the second group of STM32 microcontrollers based on the ARM Cortex-M4F core. The F3 is almost pin-to-pin compatible with the STM32 F1-series. The summary for this series is:

The STM32 F2-series of STM32 microcontrollers based on the ARM Cortex-M3 core. It is the most recent and fastest Cortex-M3 series. The F2 is pin-to-pin compatible with the STM32 F4-series. The summary for this series is:

The STM32 F1-series was the first group of STM32 microcontrollers based on the ARM Cortex-M3 core and considered their mainstream ARM microcontrollers. The F1-series has evolved over time by increasing CPU speed, size of internal memory, variety of peripherals. There are five F1 lines: Connectivity (STM32F105/107), Performance (STM32F103), USB Access (STM32F102), Access (STM32F101), Value (STM32F100). The summary for this series is:

The STM32 G4-series is a next generation of Cortex-M4F microcontrollers aiming to replace F3 series, offering the golden mean in productivity and power efficiency, e.g. better power efficiency and performance compared to the older F3/F4 series and higher performance compared to ultra low power L4 series, integrated several hardware accelerators.

The STM32 G0-series is a next generation of Cortex-M0/M0+ microcontrollers for budget market segment, offering the golden mean in productivity and power efficiency, e.g. better power efficiency and performance compared to the older F0 series and higher performance compared to ultra low power L0 series

The STM32 L4+-series is expansion of STM32L4-series of ultra-low power microcontrollers, providing more performance, more embedded memory and richer graphics and connectivity features while keeping ultra-low-power capability.

The STM32 L4-series is an evolution of STM32L1-series of ultra-low power microcontrollers. An example of L4 MCU is STM32L432KC in UFQFPN32 package, that has:

The STM32 L1-series was the first group of STM32 microcontrollers with a primary goal of ultra-low power usage for battery-powered applications. The summary for this series is:

Common peripherals included in all IC packages are USB 2.0 FS, two SPI, two I²C, three USART, eight 16-bit timers, two watchdog timers, temperature sensor, 16 to 24 channels into one ADC, two DACs, 37 to 83 GPIOs, seven DMA, real-time clock (RTC), cyclic redundancy check (CRC) engine. The STM32FL152 line adds a LCD controller.

The STM32 L0-series is the first group of STM32 microcontrollers based on the ARM Cortex-M0+ core. This series targets low power applications. The summary for this series is:

capacitive touch sense and 32-bit random number generator (only L0x2 and L0x3 chips), LCD controller (only L0x3 chips), 128-bit AES engine (only L06x chips).

All Nucleo boards by STMicroelectronics support the mbed development environment,Nucleo boards can be converted to the SEGGER J-Link debugger protocol.

NUCLEO-G431KB board for STM32G431KB6U MCU with 170 MHz Cortex-M4F core, 128 KB flash (HW ECC), 16 KB SRAM (HW parity), 6 KB SRAM, 10 KB CCM SRAM, STLINK-V3E.

NUCLEO-L412KB board for STM32L412KBU6 MCU with 80 MHz Cortex-M4F core, 128 KB flash (HW ECC), 32 KB SRAM, 8 KB SRAM (HW parity), external quad-SPI memory interface.

NUCLEO-L432KC board for STM32L432KCU6 MCU with 80 MHz Cortex-M4F core, 256 KB flash (HW ECC), 48 KB SRAM, 16 KB SRAM (HW parity), external quad-SPI memory interface.

NUCLEO-F303RE board for STM32F303RET6 MCU with 72 MHz Cortex-M4F core, 512 KB flash, 32 KB SRAM, 48 KB SRAM (HW parity), external static memory interface.

NUCLEO-F446RE board for STM32F446RET6 MCU with 180 MHz Cortex-M4F core, 512 KB flash, 128 KB SRAM, external quad-SPI memory interface, external flexible memory interface.

NUCLEO-L433RC-P board for STM32L433RCT6P MCU with 80 MHz Cortex-M4F core, 256 KB flash (HW ECC), 48 KB SRAM, 16 KB SRAM (HW parity), external quad-SPI memory interface, SMPS power.

NUCLEO-L452RE-P board for STM32L452RET6P MCU with 80 MHz Cortex-M4F core, 512 KB flash (HW ECC), 128 KB SRAM, 32 KB SRAM (HW parity), external quad-SPI memory interface, SMPS power.

NUCLEO-L452RE board for STM32L452RET6 MCU with 80 MHz Cortex-M4F core, 512 KB flash (HW ECC), 128 KB SRAM, 32 KB SRAM (HW parity), external quad-SPI memory interface.

NUCLEO-L476RG board for STM32L476RGT6 MCU with 80 MHz Cortex-M4F core, 1024 KB flash (HW ECC), 96 KB SRAM, 32 KB SRAM (HW parity), external quad-SPI memory interface, external static memory interface.

This family has 144-pin STM32 ICs, Arduino Uno Rev3 female headers, ST Zio female headers, ST Morpho male pin headers (two 19x2), second Micro-AB USB connector, and RJ45 Ethernet connector (some boards).

NUCLEO-F207ZG board for STM32F207ZGT6 MCU with 120 MHz Cortex-M3 core, 1024 KB flash (HW ECC), 128 KB SRAM, 4 KB battery-back SRAM, external static memory interface, ethernet.

NUCLEO-F303ZE board for STM32F303ZET6 MCU with 72 MHz Cortex-M4F core, 512 KB flash (HW ECC), 32 KB SRAM, 48 KB SRAM (HW parity), external static memory interface.

NUCLEO-F412ZG board for STM32F412ZGT6 MCU with 100 MHz Cortex-M4F core, 1024 KB flash, 256 KB SRAM, external quad-SPI memory interface, external static memory interface.

NUCLEO-F429ZI board for STM32F429ZIT6 MCU with 180 MHz Cortex-M4F core, 2048 KB flash, 256 KB SRAM, 4 KB battery-back SRAM, external flexible memory interface, ethernet.

NUCLEO-F439ZI board for STM32F439ZIT6 MCU with 180 MHz Cortex-M4F core, 2048 KB flash, 256 KB SRAM, 4 KB battery-back SRAM, external flexible memory interface, ethernet, cryptographic acceleration.

NUCLEO-F446ZE board for STM32F446ZET6 MCU with 180 MHz Cortex-M4F core, 512 KB flash, 128 KB SRAM, 4 KB battery-back SRAM, external quad-SPI memory interface, external flexible memory interface.

NUCLEO-F746ZG board for STM32F746ZGT6 MCU with 216 MHz Cortex-M7F core (4 KB data cache, 4 KB instruction cache), 1024 KB flash, 336 KB SRAM, 4 KB battery-back SRAM, 1 KB OTP, external quad-SPI memory interface, external flexible memory interface, ethernet.

NUCLEO-F767ZI board for STM32F767ZIT6 MCU with 216 MHz Cortex-M7F-DP core (16 KB data cache, 16 KB instruction cache), 2048 KB flash, 528 KB SRAM, 4 KB battery-back SRAM, external quad-SPI memory interface, external flexible memory interface, ethernet.

A discovery board for STM32F429ZIT6 microcontroller with 180 MHz ARM Cortex-M4F core, 2048 KB flash, 256 KB RAM, 4 KB battery-backed RAM in LQFP144 package.

This board includes an integrated ST-LINK/V2 debugger via Mini-B USB connector, 8 MB SDRAM (IS42S16400J), 2.4-inch 320x200 TFT LCD color display (SF-TC240T), touchscreen controller (STMPE811), gyroscope (L3GD20), 2 user LEDs, user button, reset button, Full-Speed USB OTG to second Micro-AB USB connector, and two 32x2 male pin headers.

A discovery board for STM32F407VGT6 microcontroller with 168 MHz ARM Cortex-M4F core, 1024 KB flash, 192 KB RAM, 4 KB battery-backed RAM in LQFP100 package.

A discovery board for STM32L152RBT6 microcontroller with 32 MHz ARM Cortex-M3 core, 128 KB flash (with ECC), 16 KB RAM, 4 KB EEPROM (with ECC) in LQFP64 package.

This board includes an integrated ST-LINK/V2 debugger via Mini-B USB connector, 24-segment LCD, touch sensors, 2 user LEDs, user button, reset button, and two 28x1 male pin headers.

A discovery board for STM32L152RCT6 microcontroller with 32 MHz ARM Cortex-M3 core, 256 KB flash (with ECC), 32 KB RAM, 8 KB EEPROM (with ECC) in LQFP64 package.

This board includes an integrated ST-LINK/V2 debugger via Mini-B USB connector, 24-segment LCD, touch sensors, 2 user LEDs, user button, reset button, and two 28x1 male pin headers.

A discovery board for STM32L100RCT6 microcontroller with 32 MHz ARM Cortex-M3 core, 256 KB flash (with ECC), 16 KB RAM, 4 KB EEPROM (with ECC) in LQFP64 package.

A ready-to-use Java development kits for its STM32 microcontrollers. The STM3220G-JAVA Starter Kit combines an evaluation version of IS2T"s MicroEJ® Software Development Kit (SDK) and the STM32F2 series microcontroller evaluation board providing everything engineers need to start their projects.

MicroEJ provides extended features to create, simulate, test and deploy Java applications in embedded systems. Support for Graphical User Interface (GUI) development includes a widget library, design tools including storyboarding, and tools for customizing fonts.STM32F205VGT6J.

A prototyping environment for a variety of STM32 variants, which allows users to create their applications using an application programming interface (API) to implement device peripherals and a range of evaluation features on the EvoPrimer base including TFT color touchscreen, graphical user interface, joy stick, codec-based audio, SD card, IrDA and standard peripherals such as USB, USART, SPI, I2C, CAN, etc.

Simulink, by MathWorks provides model-based design solutions to design embedded systems. The Embedded Coder Support Package for STMicroelectronics Discovery Boards and the Simulink Coder Support Package for STMicroelectronics Nucleo Boards provide parameter tuning, signal monitoring and one-click deployment of Simulink algorithms to STM32 boards with access to peripherals like ADC, PWM, GPIOs, I²C, SPI, SCI, TCP/IP, UDP, etc.

All STM32 microcontrollers have a ROM"ed bootloader that supports loading a binary image into its flash memory using one or more peripherals (varies by STM32 family). Since all STM32 bootloaders support loading from the USART peripheral and most boards connect the USART to RS-232 or a USB-to-UART adapter IC, thus it"s a universal method to program the STM32 microcontroller. This method requires the target to have a way to enable/disable booting from the ROM"ed bootloader (i.e. jumper / switch / button).

STMicroelectronics has additional documents, such as: evaluation board user manuals, application notes, getting started guides, software library documents, errata, and more. See External Links section for links to official STM32 and ARM documents.

The Insider"s Guide To The STM32 ARM Based Microcontroller; 2nd Edition (v1.8); Trevor Martin; Hitex; 96 pages; 2009; ISBN 0-9549988-8-X. (Download) (Other Guides)

µC/TCP-IP: The Embedded Protocol Stack for the STMicroelectronics STM32F107; 1st Edition; Christian Légaré; Micrium; 824 pages; 2010; ISBN 978-0-9823375-0-9.