Embedded graphics system
Introduction
A microcontroller based system which runs embedded graphics applications.
Graphics application
A microcontroller based interactive application which may involve any of the below components to display on the display device.
- Colors
- Color of the text
- Background color/ layer color
- Shapes
- Box
- Circle
- Arrows
- Lines
- Images
- Texts
- Graphical effects( scrolling, sliding, swipe, press, release)
- Widgets(Simple button, Radio button, Check box)
- Videos
- 3D rendering
- Gaming
To run such graphics applications, we need hardware. And our hardware system is a microcontroller based system.
Look at a simple microcontroller based graphics system( as shown in figure 1), there will be a microcontroller which we can also call a host, and the microcontroller board is connected to the display module.
This much is sufficient to run most of the Embedded graphics applications.
The display and the microcontroller board are connected with some interface. There are different interface techniques like parallel interfacing, serial interfacing, etc.
In the market, there are different display modules available, based on the technology used to lit the pixels of the display. I mean, there are LCD displays, there are LED displays, Plasma displays, OLED displays, etc.
In LCD itself there are various variants like TFT, IPS, etc.
Some of the essential parts of the Embedded graphics system
Display module: A picture is shown how the display module is able to show that image. It’s because that image information is stored in the microcontroller.
Microcontroller: It has got a permanent memory or a persistent memory called FLASH. In that Flash, the image details are stored. And then the microcontroller can send that image information, also called pixel information over the interface to the display module.
A display module has its own circuitry based on some controllers. The display module contains a controller or you can also call it as a Display driver chip.
And that display driver Chip interprets the signal which is coming over this interface. And then, the display driver chip which is present on the display module controls the pixels of the display to show different colors or information which is being sent from the host.
So, that doesn’t mean that the microcontroller should keep rendering these image data indefinitely.
The goal of this image(Figure 2) is, if you want to show an image on the display module, then you have to convert that image into a stream of bytes and you should store it somewhere in the microcontroller’s memory, like Flash memory or RAM. And then you just have to stream those bytes over the microcontroller interface to the display module. And display module has a driver chip, which interprets the signals and it controls the pixels of the display to show that information on the display.
Important parts of the Embedded graphics system
- A microcontroller(Host)
- Processor(Executes your code, updates frame buffer)
- RAM(Frame buffer)
- Flash(static images, fonts, texts, etc)
- Display Module
- Glass(where you see the graphics)
- Driver chip(Interprets the signals sent by the host, generates required electric signals and voltages to lit the pixels of the display panel)
Frame Buffer : A memory area which holds the pixel values of the frame to be updated on the display.
Other important parts of the Embedded graphics system
- Display controller (LCD controller)
- This is present at the host side
- It generates display timing-related signals
- It transmits the pixel data over the interface
In the STM32 microcontroller, there is a peripheral called LTDC, which stands for LCD-TFT Display Controller. This is inside the microcontroller. Basically, it’s a bus master. It can directly take the pixel data from the frame buffer and it can send it to the Display module over the LTDC interface. So, it has that capability. No processor intervention is required.
Even if the processor is sleeping, it can continuously stream the data which is present in the frame buffer, and it can transmit into the display module over the interface.
LTDC, which is nothing but a display controller peripheral present inside the microcontroller.
- External memories
- External Flash(your code + graphics components(images, texts) may not fit inside the internal flash)
- External RAM
And the Embedded graphics system may also consist of external memories, like External Flash or External RAM.
Sometimes you may run out of the Internal Flash of the microcontroller, in that case, you may need External Flash to store the details of your application. And sometimes you may need two frame buffers, in that case, the internal RAM may not be sufficient.
That’s why, sometimes it is required to place the frame buffer in the External RAM instead of the Internal RAM, because there may not be much space left in the Internal RAM.
- Graphics library (LVGL, TouchGFX)
You may also use an already available graphics stack or graphics libraries in your application, like LVGL, or Touch graphics, or TouchGFX. These are graphics middleware or you can also call it as graphics libraries, which will be helpful when you want to build a complex interactive graphics application.
- UI designer tool
- To create an interactive UI application
By using which you can create an interactive UI application for your project, it just auto-generates all the code for your interactive application.
So, the interactivity you can define using the designer tool itself.
- Touch sensing
- Touch panel
- Touch screen controller(Which senses touch panel and informs HOST)
And after that, Touch sensing. To sense the touch, you need a touch panel, like a resistive touch panel or a capacitive touch panel. And there should be a Touch screen controller.
A touch screen controller senses the touch panel and it converts that touch to some digital data or something, and then it informs the HOST. For the interactive UI application, touch sensing is also important.
- DMA
- Helps to transfer frame buffer to display without the intervention of the CPU
- Helps to transfer graphics details from flash to frame buffer without the intervention of the CPU
DMA(Direct Memory Access) is also one of the important parts of the Embedded graphics system. Most microcontrollers have this feature, the DMA capability. The DMA capability can be used to transfer the frame buffer to display without the intervention of the CPU.
I just mentioned LTDC. LTDC has that capability. It’s a bus master, so it can do direct memory access. And the DMA also helps us to transfer graphics details from Flash to the frame buffer without the intervention of the CPU.
Any questions ? please leave a comment and share this article.
Get the Full Course on STM32-LTDC, LCD-TFT, LVGL (MCU3) Here.
FastBit Embedded Brain Academy Courses
Click here: https://fastbitlab.com/course1