stm32f429 discovery tft lcd free sample

STM32F429 has also LTDC driver for LCD like that, but this driver we will use later. For now we will use SPI for driving in serial mode and some other pins for controlling.

Remember: This library can also be used, if you are not using STM32F429 Discovery. It can be used in previous STM32F4 Discovery board. All pins can be changed in defines.h file which is included in project.

stm32f429 discovery tft lcd free sample

One of my favorite features of the STM32F429 discovery board is the TFT-LCD display. After setting up the programming IDE I started looking at the code examples given by ST. One code example caught my eye: The "LTDC_Display_2Layers" project.

stm32f429 discovery tft lcd free sample

The STM32F429 Discovery helps you to discover the high-performance microcontrollers of the STM32 F4 series and to develop your applications easily. It offers everything required for beginners and experienced users to get started quickly.

Based on the STM32F429ZIT6, it includes an ST-LINK/V2 embedded debug tool, a 2.4" QVGA TFT LCD, an external SDRAM of 64 Mbits, a gyroscope ST MEMs, a USB OTG micro-AB connector, LEDs and pushbuttons.

A large number of free ready-to-run application firmware examples are available on www.st.com/stm32f4-discovery to support quick evaluation and development.

stm32f429 discovery tft lcd 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()

stm32f429 discovery tft lcd free sample

The STM32F429 Discovery kit (32F429IDISCOVERY) allows users to easily develop applications with the STM32F429 high-performance MCUs with ARM®Cortex®-M4 core.

It includes an ST-LINK/V2-B embedded debug tool, a 2.4" QVGA TFT LCD, an external 64-Mbit SDRAM, an ST MEMS gyroscope, a USB OTG micro-AB connector, LEDs and push-buttons.

For Technical Documentation, Software & Development Tools, Hardware Resources, view the 32F429IDISCOVERY official page on www.st.com to get more information: http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF259090

stm32f429 discovery tft lcd free sample

The STM32F429 Discovery kit (32F429IDISCOVERY) allows users to easily develop applications with the STM32F429 high-performance MCUs with ARM®Cortex®-M4 core.

It includes an ST-LINK/V2-B embedded debug tool, a 2.4" QVGA TFT LCD, an external 64-Mbit SDRAM, an ST MEMS gyroscope, a USB OTG micro-AB connector, LEDs and push-buttons.

ForTechnical Documentation,Software & Development Tools,Hardware Resources, view the 32F429IDISCOVERY official page on www.st.com to get more information:http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF259090

stm32f429 discovery tft lcd free sample

The 32F429IDISCOVERY kit leverages the capabilities of the STM32F429 high-performance microcontrollers, to allow users to easily develop rich applications with advanced Graphic User interfaces.

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)