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.
Previous article:Research on STM32F767 TF card and FAT file system
Next article:STM32 timer---Detailed explanation of quadrature encoder mode
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- A brief talk about RISC-V GCC: Linker script learning notes (I)
- How to insert assembly code in Keil 5 version?
- [Raspberry Pi Pico Review] VII. Raspberry Pi Pico Review Summary
- Gaoyun FPGA logic analyzer function usage
- Does anyone have a good thermostat switch?
- Particle Xenon nRF52840 BLE Development Board
- Technical Science: The Essential Differences between DRAM and NAND
- Sugar glider ③ RSL10-SENSE-GEVK light sensor driver is written and shared with everyone
- When using the stc8 series for ADC multi-channel sampling, the sampling data of one channel is sometimes accurate and sometimes wrong.
- STM32F205 series MCU OTP problem