2016-11-08 01:22 AM
Hello,
I am developing an application that has:1. LCD Touchscreen2. STM32F4693. External Flash on QSPI4. External SRAMOther peripherals shall be an RS232 controller, a Wi-Fi Module and 2 flow meters.I have to acquire data from the flow meters and display it on the screen. The data has to be sent to a server over a Wi-Fi Connection.Size of the screen: 7 inchesInterface: RGB parallel, 24bitsSize of SRAM 8MB.Size of Flash: 16MB.I have a few basic questions with this implementation.1. How are the screens stored in the flash memory? What would be the procedure to program them in the flash memory? Can it bedone at the time of programming the microcontroller?2. What is the procedure to display the screens on the LCD? The screens stored in the flash, have to be copied to the RAM and then they can be sent to the LCD, is this assumption correct? 3. I believe that the LCD shall be interfaced to the micro controller on LTDC. Though I do not fully understand it, the data shall move between LCD and RAM using the DMA controller on the STM32. How does this exactly work?4. I require widgets like sliders, scroll, text boxes, keyboard on the display .I am planning to use the STEMWIN grpahics library. Would all these features be available using this library?I have all these basic questions as I have not worked on interfacing RGB LCD with a micro controller. Request kind assistance, thank you very much!Best Regards, Makarand Deshmukh #lcd #rgb2016-11-08 05:05 AM
1. How are the screens stored in the flash memory?
This depends on the LTDC mode you are going to use etc. In general it can be in any format, where every pixel is represented by a set of bytes in (A)RGB format. Which means for every screen you would need height x width x color bit depth (in your case 24 bits or 3 bytes). What would be the procedure to program them in the flash memory? Keil, IAR or ST-Link utility have the feature to create a so called flash loader. This loader is enabled, in the linker script you need to map your pictures into your external FLASH memory location and the flash loader attached to your project will load the data into the flash. These tools already incorporate some flash loaders for the discovery boards etc. Also for the ST-Link utility, there are some ''template projects'', which can be adjusted to your needs and compiled and attached to the ST-Link utility, so you are able to flash you external memory as well. Can it be done at the time of programming the microcontroller? Yes, for sure.2. What is the procedure to display the screens on the LCD? The screens stored in the flash, have to be copied to the RAM and then they can be sent to the LCD, is this assumption correct?
When you are configuring the LTDC peripheral, there is also a pointer to the so called frame buffer. This is an address where your picture is stored. Usually this is in an SDRAM, but i can also be your internal/external flash. However there can be some speed limitations, that's why the SDRAM is used, as reading and writing into SDRAM is/should be faster.3. I believe that the LCD shall be interfaced to the micro controller on LTDC. Though I do not fully understand it, the data shall move between LCD and RAM using the DMA controller on the STM32. How does this exactly work?
This happens through the frame buffer mentioned above. The LTDC has an address (two in fact, one for each window layer), which points to your frame buffer (usually into SDRAM). The data are transffered from SDRAM into the LTDC peripheral. Actually this should happen without the need of the MCU action. If you take a look onto the MCU's bus matrix in the reference manual, the TLDC has direct access to the FMC! So the LTDC knows, where to find the data, how big the picture is etc. and it simply reads the bytes from that destination. If it's on SDRAM, there is some access on the FMC and the FMC makes the read and provides the data back through the AHB bus I guess, but that's not important.4. I require widgets like sliders, scroll, text boxes, keyboard on the display .I am planning to use the STEMWIN grpahics library. Would all these features be available using this library?
I would higly recommend to take a look into the emWin user manual, which lists contains all the features the library incorporates. There are additional libraries on the market you can use like TouchGFX or Embedded Wizard I guess. Try to have a look on these and according to the information you gather decide, which library suits you best! I hope my answers help you to move forward! Have a nice day, Renegade2016-11-09 03:15 AM
Hello Renegade,
Thank you for your answers, they have been helpful.Continuing our discussion....1. How are the screens stored in the flash memory?This depends on the LTDC mode you are going to use etc. In general it can be in any format, where every pixel is represented by a set of bytes in (A)RGB format. Which means for every screen you would need height x width x color bit depth (in your case 24 bits or 3 bytes).-> OK. So basically I can store an image in the flash memory as a bitmap with pixel data having three values for every pixel (RGB). So I would assume for a 800x480 sized display, I would require 800x480x3 = 1.1MB of flash memory / image. The pointer for the first image would start from 0x00000 to 0x5DC00 (800x480), second image from 0x5DC01 to 0xBB800 and so on. Is that correct?What would be the procedure to program them in the flash memory?Keil, IAR or ST-Link utility have the feature to create a so called flash loader. This loader is enabled, in the linker script you need to map your pictures into your external FLASH memory location and the flash loader attached to your project will load the data into the flash. These tools already incorporate some flash loaders for the discovery boards etc. Also for the ST-Link utility, there are some ''template projects'', which can be adjusted to your needs and compiled and attached to the ST-Link utility, so you are able to flash you external memory as well.-> Okay, I shall check these utilities. Although conceptually, I would like to know how it works. The flash will be based on the QSPI peripheral, which I am assuming I will initialise after my MCU is init. Then how does the linker write to the memory when the peripheral is not initialized?Can it be done at the time of programming the microcontroller?Yes, for sure.-> Okay!2. What is the procedure to display the screens on the LCD? The screens stored in the flash, have to be copied to the RAM and then they can be sent to the LCD, is this assumption correct? When you are configuring the LTDC peripheral, there is also a pointer to the so called frame buffer. This is an address where your picture is stored. Usually this is in an SDRAM, but i can also be your internal/external flash. However there can be some speed limitations, that's why the SDRAM is used, as reading and writing into SDRAM is/should be faster.-> So, I understand that in my case, I will have to copy the image of interest to the SRAM first from the flash memory. Say I want to display image one, from point no 1, then I will have to start from 0x00 address and go ahead till the end of the image. I would also assume, copying image from flash to RAM would be slower than displaying the image from the RAM, so I would have to copy a one or two or more screens to the RAM. Is that why having more RAM would be more useful? TO have a larger frame buffer and being able to store multiple screens at one time.3. I believe that the LCD shall be interfaced to the micro controller on LTDC. Though I do not fully understand it, the data shall move between LCD and RAM using the DMA controller on the STM32. How does this exactly work?This happens through the frame buffer mentioned above. The LTDC has an address (two in fact, one for each window layer), which points to your frame buffer (usually into SDRAM). The data are transffered from SDRAM into the LTDC peripheral. Actually this should happen without the need of the MCU action. If you take a look onto the MCU's bus matrix in the reference manual, the TLDC has direct access to the FMC! So the LTDC knows, where to find the data, how big the picture is etc. and it simply reads the bytes from that destination. If it's on SDRAM, there is some access on the FMC and the FMC makes the read and provides the data back through the AHB bus I guess, but that's not important.-> What do you mean when you say ''one for each window layer?'' What is a window layer?-> So if I understand correctly I will have to do the following steps1. Setup the LTDC2. Set Clock and other signals as per the display datasheet3. The LCD shall be connected to the controller over 24 parallel lines + other required lines.4. The LTDC address shall be pointing to the address of the RAM which contains the starting pixel data of the image to be displayed and then increment the pointer until the image is complete. Correct?4. I require widgets like sliders, scroll, text boxes, keyboard on the display .I am planning to use the STEMWIN grpahics library. Would all these features be available using this library?I would higly recommend to take a look into the emWin user manual, which lists contains all the features the library incorporates. There are additional libraries on the market you can use like TouchGFX or Embedded Wizard I guess. Try to have a look on these and according to the information you gather decide, which library suits you best!-> Okay, I will check the manual. STEMWIN would be a free version for use with the STM32 controller. I have also looked at TouchGFX earlier. Prior to looking at a library, I would like to understand the physical operation also.Best Regards,Makarand