With the rapid development of semiconductor technology and computer hardware and software technology, there are more and more ways to control the display of images. This article introduces a new method to control LCD-LQ057Q3DC02 based on NIOS II soft-core processor. In the design, the NIOS II soft-core processor and its "soft" hardware modules related to the display function are customized using FPGA Altera's SOPC Builder to collaboratively implement the software and hardware design of display control. Using SOPC technology, the NIOS II CPU and LCD controller are placed in the same FPGA, which solves the problem that LCD display can only be solved by using a dedicated LCD control chip.
1 LCD selection and main features
The LCD used in this article is SHARP's 5.7-inch LCD-LQ057Q3DC02. It can display 320×240×3 pixels. The input signals include: 18-bit color signal (6 bits for each R, G, and B) data signal, 4 clock signals (CLK, Hsync, Vsync, Enable), and R/L, U/D, and VGA/QVGA mode selection signal lines for horizontal display mode and vertical display mode.
In fact, LCD-LQ057Q3DC02 is a line-by-line scanning device. It always starts scanning from the upper left corner of the screen, first scans a line (320 pixels) horizontally to the rightmost, then returns to the leftmost, changes to the next line, and continues scanning. Until the bottom of the screen is scanned (a total of 240 lines), a frame of the image is scanned, and then returns to the leftmost to start scanning the next frame.
2 Avalon Stream Mode LCD Controller Design
The LCD real-time image display control method implemented in this article adopts the DMA data transmission method. During the design, a DMA transfer channel is established between the streaming mode LCD controller and SDRAM using the DMA controller, allowing the hardware to automatically read the pixel information, and the NIOS II processor can update the LCD image by simply operating the corresponding blocks in the SDRAM.
2.1 Composition of the Avalon streaming mode controller
The Avalon bus specification must be followed when designing Avalon streaming mode peripherals. In actual design, the hardware structure of the Avalon streaming mode LCD controller designed by the author is shown in Figure 1. The controller consists of the following three parts: LCD interface controller, FIFO memory, and Avalon Streaming Port interface.
2.2 LCD display control flow
For LCD-LQ057Q3DC02, to achieve normal LCD display, the corresponding control signals must be correctly configured, especially the line synchronization (LCD_Hsync) and field synchronization (LCD_Vsync) must be synchronized with the image data taken from the SDRAM memory, otherwise, the image will not be reproduced normally. The control timing flow of line synchronization and field synchronization for LCD control is shown in Figure 2.
2.3 LCD controller file composition and part of the code
There are three module files corresponding to the LCD controller hardware, namely: LCD_interface.vhd, LCD_pixel_fifo.v and LCD_controller_stream.v. LCD_controller_stream.v is the top-level module, which also contains the Avalon Streaming Port interface timing part. LCD_pixel_fifo.v can be directly generated through the macro module in QuartusII. After the above three files are generated, you can select the System->Add Interface to User Logic command in SOPC Builder to open the Interface to User Logic dialog box and select the bus type as Avalon Memory Slave, because the LCD controller working in streaming mode can be regarded as a memory (FIFO type), and the DMA setting from memory (FIFO) to memory (SDRAM) can be realized by adding a DMA controller. The following is a partial program of the LCD interface.
ENTITY LCD_interface IS
PORT(
reset :IN std_logic;
lcd_clk :IN std_logic;
Wrdata :IN std_logic_vector(17 downto 0);
hsync :OUT std_logic;
vsync :OUT std_logic;
enable :OUT std_logic;
lcd_R/L :OUT std_logic;
lcd_U/D :OUT std_logic;
sel_VGA_QVGA :OUT st d_logic;
RGB :OUT std_logic_vector(17 downto 0);
end_of_picture :OUT std_logic);
END LCD_interface;
ARCHITECTURE trans OF LCD_interface IS
process(lcd_clk) begin
if(rising_edge(lcd_clk)) then
if(hcnt<400) then
hcnt<=hcnt+1;
else
end
if
;
k
)
begin
if(rising_edge(lcd_clk)) then
if
((hcnt>= 320+20
+20
) and (hcnt<320+20
+20+40)) then
hs<
=0
;
else
hs<=1;
end if;
end
if
;
end
process;--generate horizontal synchronization pulse
process
(
vcnt
)
begin
if((vcnt>=240+6+6)and(vcnt<240+6+6+10)) then
VS<=0;
else
vs<=1;
end if;
end process;--Generate field synchronization pulseprocess
(lcd_clk) begin
if(rising_edge(lcd_clk)) then
if(hcnt<320 and vcnt<240)and(hcnt>20 and vcnt>6) then
en<=1;
else
en<=0;
end if;
end if;
end process;--Generate display enable control signalprocess
(led_clk)begin
if(rising_edge(lcd_clk))then
if(hcnt<320 and vcnt<240)then
RGB<=Wdata;
else
RGB<=(others=>0);
end if;
end if;
end process;--Pixel output and blankingprocess
(lcd_clk)begin
if(rising_edge(lcd_clk))then
if((vcnt=320+1)and(hcnt=0))then
end_of_picture<=1;
else
end_of_picture<=0;
end if;
end if;
end process;--One frame transmission is completedEND
ARCHITECTURE trans;
3 DMA control process and experimental conclusion
3.1 Program flow under DMA transmission mode
The use of this solution to realize LCD display has been verified in a certain area array CCD acquisition system. In the actual system, this part mainly realizes the dynamic display of the image data collected by the area array CCD image sensor. In the actual acquisition control system, two DMAs are selected, one for image data acquisition and the other for image reproduction after acquisition. Only the corresponding modules under the display DMA transmission control mode are introduced in this article. In the actual system, the image data is collected from the area array CCD image sensor to SDRAM in DMA control mode, and the collected image data is displayed from SDRAM to LCD. The DMA control process in the actual system is shown in Figure 3.
3.2 Experimental conclusion
According to Figure 3, the image data of the area array CCD collected is stored in SDRAM. The image data extracted at a certain ratio is synthesized into an 18-bit RGB image signal in SDRAM. Then, under the control of the NIOS II processor and display DMA, a complete frame of the image is displayed on the LCD. The actual control display result is shown in Figure 4.
4 Conclusion
Using NIOS II as a solution for controlling LCD with FPGA embedded processor can easily realize DMA transmission and control of image data. The system can selectively customize the corresponding modules according to actual needs, making the system more flexible. At the same time, since the LCD control is realized by using "soft" hardware, the purpose of improving hardware functions can be achieved by constantly changing the "software" during the debugging process.
Previous article:Analysis and Research on Display Decoder Design in Digital Circuit
Next article:MOS tube short channel effect and its behavior modeling
Recommended ReadingLatest update time:2024-11-16 17:44
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- A collection of autonomous driving technical materials, download now without any points!
- Switch OUT?! Nintendo's latest recruitment may be aimed at the next generation console
- 【ST NUCLEO-H743ZI Review】+ 3. Key input
- Today's Live Broadcast | Outlook for DLP Technology in AR HUD and In-Vehicle Display Applications
- Award-winning live broadcast: Focus on "TI FPD-Link III automotive chipset" Ideal solution for automotive video transmission
- Playing with Zynq Serial 1——Zynq Linux boot process
- 【AT-START-F425 Review】Overclocking Performance of AT32F425
- I can't access GitHub anymore, what should I do? I can't access it at all
- [Mill MYB-YT507 development board trial experience] opencv face detection
- TouchGFX application development based on STM32CubeMX on STM32H7A3 processor - HelloWorld!