STM32F7 18 LCD-TFT display controller (LTDC)

Started by tha, December 08, 2022, 08:38:41 AM

Previous topic - Next topic

tha

18 LCD-TFT display controller (LTDC)

ส่วนนี้ใช้กับ the whole STM32F756xx, STM32F750xx and STM32F746xx devices, เว้นแต่จะระบุไว้เป็นอย่างอื่น.

18.1 Introduction

The LCD-TFT (liquid crystal display - thin film transistor) display controller จัดให้มี a parallel digital RGB (red, green, blue) และสัญญานสำหรับ horizontal, vertical synchronization, pixel clock และ data enable เป็น output เพื่ออินเตอร์เฟซโดยตรงกับความหลากหลายของ LCD and TFT panels.

tha

18.2 LTDC main features

•   24-bit RGB parallel pixel output; 8 bits-per-pixel (RGB888)
•   2 display layers ที่มี dedicated FIFO (64x32-bit)
•   Color look-up table (CLUT) มากถึง 256 color (256x24-bit) per layer
•   Programmable timings สำหรับ different display panels
•   Programmable background color
•   Programmable polarity สำหรับ HSYNC, VSYNC and data enable
•   มากถึง 8 input color formats selectable per layer
     –   ARGB8888
     –   RGB888
     –   RGB565
     –   ARGB1555
     –   ARGB4444
     –   L8 (8-bit luminance or CLUT)
     –   AL44 (4-bit alpha + 4-bit luminance)
     –   AL88 (8-bit alpha + 8-bit luminance)
•   Pseudo-random dithering output สำหรับ low bits per channel
     –   Dither width 2-bits สำหรับ red, green, blue
•   การผสมที่ยืดหยุ่นระหว่าง two layers โดยใช้ alpha value (ต่อ pixel หรือ constant)
•   Color keying (transparency color)
•   Programmable window position and size
•   รองรับ thin film transistor (TFT) color displays
•   AHB master interface ที่มีการส่งข้อมูลเป็นชุดอย่างเร็ว 16 words
•   มากถึง 4 programmable interrupt events

tha

18.3 LTDC functional description

18.3.1 LTDC block diagram

The block diagram of the LTDC ถูกแสดงใน Figure 111: LTDC block diagram.



Layer FIFO: หนึ่ง FIFO 64x32-bit ต่อ layer.

PFC: pixel format converter, ดำเนินการ the pixel format conversion จาก the selected input pixel format of a layer ไปเป็น words.

AHB interface: สำหรับ data transfer จาก memories ไปยัง the FIFO.

Blending, dithering unit and timings generator: ดูที่ Section 18.4.1 and Section 18.4.2.


tha

18.3.2 LTDC pins and external signal interface

Table 116 สรุป the LTDC signal interface.




The LTDC-TFT controller pins ต้องถูกกำหนดค่าโดย the user application. The unused pins สามารถถูกใช้สำหรับวัตถุประสงค์อื่น.

สำหรับ LTDC outputs มากถึง 24-bit (RGB888), ถ้าน้อยกว่า 8 bpp ถูกใช้เพื่อเอ๊าพุทตัวอย่างเช่น RGB565 or RGB666 เพื่ออินเตอร์เฟซบน 16- or 18-bit displays, the RGB display data lines ต้องถูกต่อกับ the MSB of the LCD-TFT controller RGB data lines. ดังตัวอย่าง, ในกรณีของ an LCD-TFT controller อินเตอณ์เฟซกับ a RGB565 16-bit display, the LCD display R[4:0], G[5:0] and B[4:0] data lines pins ต้องถูกต่อกับ LCD-TFT controller LCD_R[7:3], LCD_G[7:2] and LCD_B[7:3].

tha

18.3.3 LTDC reset and clocks

The LCD-TFT controller peripheral ใช้ 3 clock domains:
•   AHB clock domain (HCLK)
     โดเมนนี้บรรจุ the LCD-TFT AHB master interface สำหรับ data transfer จาก the memories ไปยัง the Layer FIFO และ
     the frame buffer configuration register
•   APB2 clock domain (PCLK2):
     โดเมนนี้บรรจุ the global configuration registers และ the interrupt register.
•   Pixel clock domain (LCD_CLK)
     โดเมนนี้บรรจุ the pixel data generation, the layer configuration register ตลอดจน the LCD-TFT interface signal
     generator. The LCD_CLK output ควรถูกกำหนดค่าตาม the panel requirements. The LCD_CLK ถูกสร้างจาก a specific
     PLL output (ดูที่ the reset and clock control section).

Table 117 สรุป the clock domain สำหรับแต่ละ register.




ต้องใช้ความระมัดระวังในขณะที่เข้าถึง the LTDC registers, the APB2 bus จะถูกหยุดในระหว่าง:
•   6 PCKL2 periods + 5 LCD_CLK periods (5 HCLK periods สำหรับ register บน AHB clock domain) สำหรับ register
     write access และ update;
•   7 PCKL2 periods + 5 LCD_CLK periods (5 HCLK periods สำหรับ register บน AHB clock domain) สำหรับ register
     read access.

สำหรับ registers บน PCLK2 clock domain, APB2 bus จะถูกหยุดเป็นเวลา 6 PCKL2 periods ในระหว่าง the register write accesses, และเป็นเวลา 7 PCKL2 periods ในระหว่าง Read accesses.

The LCD controller สามารถถูกรีเซ็ตโดยการเซ็ตบิตที่ตรงกันใน the RCC_APB2RSTR register. มันรีเซ็ต the three clock domains.

tha

18.4 LTDC programmable parameters

The LCD-TFT controller จัดให้มี flexible configurable parameters. มันสามารถถูกเปิดใช้งานหรือถูกปิดใช้งานผ่านทาง the LTDC_GCR register.

18.4.1 LTDC global configuration parameters

Synchronous timings

Figure 112 แสดง the configurable timing parameters ที่สร้างโดย the synchronous timings generator block ที่แสดงใน the block diagram Figure 111. มันสร้าง the horizontal and vertical synchronization timings panel signals, the pixel clock and the data enable signals.



Note: The HBP and HFP คือ the horizontal back porch และ front porch period ตามลำดับ.
          The VBP and the VFP คือ the vertical back porch และ front porch period ตามลำดับ.


The LCD-TFT programmable synchronous timings คือ:
•   HSYNC and VSYNC width: horizontal and vertical synchronization width, ถูกกำหนดค่าโดยการโปรแกรมค่าของ   
     HSYNC width - 1 and VSYNC width - 1 ใน the LTDC_SSCR register
•   HBP and VBP: horizontal and vertical synchronization back porch width, ถูกกำหนดค่าโดยการโปรแกรมค่าสะสม   
     HSYNC width + HBP - 1 และค่าสะสม VSYNC width + VBP - 1 ใน the LTDC_BPCR register.
•   Active width and active height: the active width and active height ถูกกำหนดค่าโดยการโปรแกรมค่าสะสม           
     HSYNC width + HBP + active width - 1 และค่าสะสม VSYNC width + VBP + active height - 1 ใน the
     LTDC_AWCR register (เฉพาะมากถึง 1024x768 เท่านั้นถูกรองรับ).
•   Total width: the total width ถูกกำหนดค่าโดยการโปรแกรมค่าสะสม HSYNC width + HBP + active width + HFP - 1     
     ใน the LTDC_TWCR register. The HFP คือ the horizontal front porch period.
•   Total height: the total height ถูกกำหนดค่าโดยการโปรแกรมค่าสะสม VSYNC height + VBP + active height + VFP - 1 
     ใน the LTDC_TWCR register. The VFP คือ the vertical front porch period.

Note:   When the LTDC ถูกเปิดใช้งาน, the timings ที่สร้างจะสตาร์ทด้วย X/Y=0/0 position เป็น the first horizontal
            synchronization pixel ใน the vertical synchronization area และตามหลัง the back porch, active data display
            area และ the front porch.


เมื่อ the LTDC ถูกปิดใช้งาน, the timing generator block ถูกรีเซ็ตเป็น X = total width - 1, Y = total height - 1 และถือ the last pixel ก่อน the vertical synchronization phase และ the FIFO จะถูกล้าง. ดังนั้นเฉพาะ blanking data จะถูกส่งออกอย่างต่อเนื่อง.

tha

Example of synchronous timings configuration

TFT-LCD timings (ต้องถูกดึงจาก panel datasheet):
•   horizontal and vertical synchronization width: 0xA pixels and 0x2 lines
•   horizontal and vertical back porch: 0x14 pixels and 0x2 lines
•   active width and active height: 0x140 pixels, 0xF0 lines (320x240)
•   horizontal front porch: 0xA pixels
•   vertical front porch: 0x4 lines

ค่าที่โปรแกรมใน the LTDC timings registers คือ:
•   LTDC_SSCR register: ถูกโปรแกรมเป็น 0x00070003. (HSW[11:0] คือ 0x7 และ VSH[10:0] คือ 0x3)
•   LTDC_BPCR register: ถูกโปรแกรมเป็น 0x001D0003 (AHBP[11:0] คือ 0x1D(0xA + 0x13) และ AVBP[10:0]A คือ
     0x3(0x2 + 0x1)).
•   LTDC_AWCR register: ถูกโปรแกรมเป็น 0x015D00F3 (AAW[11:0] คือ 0x15D(0xA + 0x14 + 0x13F) และ AAH[10:0]
     คือ 0xF3(0x2 + 0x2 + 0xEF).
•   LTDC_TWCR register: ถูกโปรแกรมเป็น 0x00000167 (TOTALW[11:0] คือ 0x167(0xA + 0x14 + 0x140 + 0x9).
•   LTDC_THCR register: ถูกโปรแกรมเป็น 0x000000F7 (TOTALH[10:0] คือ 0xF7(0x2 + x2 + 0xF0 + 3)

tha

Programmable polarity

The horizontal and vertical synchronization, data enable and pixel clock output signals polarity สามารถถูกโปรแกรมเป็นแอคทีฟ high หรือแอคทีฟ low ผ่านทาง the LTDC_GCR register.

Background color

A constant background color (RGB888) สามารถถูกโปรแกรมผ่านทาง the LTDC_BCCR register. มันถูกใช้สำหรับการผสมกับ the bottom layer.