STM32f429-SDRAM+LTDC Summary

Publisher:ArtisticSoulLatest update time:2018-07-19 Source: eefocusKeywords:STM32f429  SDRAM  LTDC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I bought an STM32F429I-DISC1 and planned to do something a little more complicated, such as LCD driver, camera driver, DSP and so on.

First, let's get the LCD driver. F429 provides an LTDC interface, which can directly drive the screen in RGB mode. Using RGB mode requires a relatively large RAM, but the onboard RAM of general MCUs is very small, and it is all done through an external SDRAM. The principle of SDRAM is the same as the external DDR memory of a computer. F429 has an 8Mbyte SDRAM onboard.


To understand some common knowledge about SDRAM, I read a doc, "Advanced for Experts, Ultimate Memory Technology Guide - Complete.doc", which talks a lot about SDRAM timing and parameters.

SDRAM principle: There are row addresses, column addresses, address lines, etc. When reading each block, that is, Bank, first locate the row address and then locate the column address, etc., and some read and write timings and some key parameter settings:

Such as tRCD, CAS Latency, tRP, tWR, etc., these must be configured in the code, according to the SDRAM data sheet (IS42S16400J used by DISC1)

Specific code engineering configuration:

1. The configuration of FMC, that is, the IO configuration of SDRAM (address line, CS signal, data line, Bank selection line, CLK, etc.), can be directly generated by CubeMx. It can be configured with memory address, number of banks, number of rows and columns, and CAS, TRCD, etc. are all based on clock signals.

2. Clock configuration FMC_SDRAM_CMD_CLK_ENABLE

3.PALL precharge storage area FMC_SDRAM_CMD_PALL

4. Self-refresh FMC_SDRAM_CMD_AUTOREFRESH_MODE

5. Set a bunch of things like mode register, burst length, etc...

6. Refresh rate setting (refresh rate is 64ms ÷ (4096 rows) = 15.7us SDRAM uses 108MHz, refresh cycle is: 15.7us × 90MHz count = 1413-20)

With this setup, SDRAM can be read and written at will. Then it can be used by LTDC and DMA2D.


LCD screen driver is the configuration of RGB drive mode, that is, the configuration of LTDC interface, which can be configured in CubeMX

The principle of RGB driving method is actually quite simple. For the three RGB colors, each with a maximum of 8 bits is RGB888, and 16 bits is RGB565. The refresh method is one VSYNC and one HSYNC, one for one frame and one for one line.

F429 is divided into a background layer and two user layers. You can display it by configuring the corresponding parameters. If the display is not complete, just adjust the parameters.

However, just setting LTDC will not light up the screen of the development board. The reason is that the LCD on the STM32F429I-Disc1 development board has a driver IC-ILI9341, so you need to use SPI to give it some initialization commands before it can light up. For details, please refer to the official factory routine.

I also don’t understand why this screen cannot be driven using RGB alone. If using the RGB method, the driver IC still needs to be initialized.

Finally, use ST's own tool to generate an image.h and display it on the screen using DMA2D. The test is OK.


Keywords:STM32f429  SDRAM  LTDC Reference address:STM32f429-SDRAM+LTDC Summary

Previous article:Research on STM32F767 TF card and FAT file system
Next article:STM32 timer---Detailed explanation of quadrature encoder mode

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号