STM32: How LTDC Works.
About six months ago, one of the site's regular visitors sent me an STM32F429I DISCO development board.
When I told him I didn't need it, he replied that it was a gift and I should accept it. He had also read somewhere that the RAM on the board is needed for the display and asked me what exactly for, but I didn't have an answer to that question. It was clear that the RAM acts as a buffer for storing information, but for me that's not an answer; I had managed without it before. When the board arrived, I checked that it worked, put it in a cupboard and forgot about it.
Quite recently I came across a video on YouTube in which people had made an oscilloscope on that very board, but what interested me was not the oscilloscope but the fact that one image was overlaid on another semi-transparent one. Yes, it was precisely the semi-transparency: I had never seen this in the displays I had worked with before; they just drew one image on top of another. This interested me, and I started looking for information on what the RAM is actually needed for and how to make the display work.
It very soon turned out that the STM32F429ZI has a thing called the LCD-TFT display controller, or LTDC for short, and layer blending and transparency are its features. The display itself is actually an ordinary one with a single physical layer, connected via the RGB interface.
Broadly speaking, all displays can be divided into two categories: with built-in graphics memory (GRAM) and without it.
The pictures show that GRAM must be present, and if the display doesn't have it, it can be located either inside the microcontroller or connected to it.
The LTDC has no memory of its own, so depending on the display size there are two options for where the GRAM is located: either inside the MCU or in an external memory chip.
I think many have already guessed that the RAM mentioned at the beginning of the article serves as the GRAM.
So how does it all work?
The initial display initialization is done over SPI, and that's where RGB is selected as the control interface. Next, when configuring the LTDC, we specify the start address of the buffer and its size (that very GRAM). The buffer itself will be located in the RAM, but using the FMC we can access the RAM as if it were in the microcontroller's memory. Once all the peripherals are initialized, to draw an image on the display it's enough to put it into the buffer; LTDC will do the rest for us. Below you can watch a video of the display in action.
When I told him I didn't need it, he replied that it was a gift and I should accept it. He had also read somewhere that the RAM on the board is needed for the display and asked me what exactly for, but I didn't have an answer to that question. It was clear that the RAM acts as a buffer for storing information, but for me that's not an answer; I had managed without it before. When the board arrived, I checked that it worked, put it in a cupboard and forgot about it.
Quite recently I came across a video on YouTube in which people had made an oscilloscope on that very board, but what interested me was not the oscilloscope but the fact that one image was overlaid on another semi-transparent one. Yes, it was precisely the semi-transparency: I had never seen this in the displays I had worked with before; they just drew one image on top of another. This interested me, and I started looking for information on what the RAM is actually needed for and how to make the display work.
It very soon turned out that the STM32F429ZI has a thing called the LCD-TFT display controller, or LTDC for short, and layer blending and transparency are its features. The display itself is actually an ordinary one with a single physical layer, connected via the RGB interface.
Broadly speaking, all displays can be divided into two categories: with built-in graphics memory (GRAM) and without it.
The pictures show that GRAM must be present, and if the display doesn't have it, it can be located either inside the microcontroller or connected to it.
The LTDC has no memory of its own, so depending on the display size there are two options for where the GRAM is located: either inside the MCU or in an external memory chip.
I think many have already guessed that the RAM mentioned at the beginning of the article serves as the GRAM.
So how does it all work?
The initial display initialization is done over SPI, and that's where RGB is selected as the control interface. Next, when configuring the LTDC, we specify the start address of the buffer and its size (that very GRAM). The buffer itself will be located in the RAM, but using the FMC we can access the RAM as if it were in the microcontroller's memory. Once all the peripherals are initialized, to draw an image on the display it's enough to put it into the buffer; LTDC will do the rest for us. Below you can watch a video of the display in action.







