Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ST7272A driver with LTDC of STM32H743

Status
Not open for further replies.
Joined
May 26, 2022
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
29
Hello Folks,

I am trying to initialize and use the TFT-Display module ST7272A using LTDC driver of STM32H743 microcontroller.
I am newbie for TFT-Display. I do not know the command and sequence in which data has to be sent using SPI and RGB lines to TFT display.
Please help me in understanding how to make this work.

Attaching the snip of lwip initialization using LTDC driver of STM32H743.
Code:
void ltdc_init()
{

    // enable ltdc clock
    __HAL_RCC_LTDC_CLK_ENABLE();
//    __HAL_RCC_DSI_CLK_ENABLE();
    __HAL_RCC_WWDG1_CLK_ENABLE();

    const int h_sync = 4;
    const int h_back_porch = 43;
    const int h_active = 320;
    const int h_front_porch = 8;

    const int v_sync = 4;
    const int v_back_porch = 12;
    const int v_active = 240;
    const int v_front_porch = 2;

    // configure the panel timings and signal polarity
    LTDC->GCR &= ~LTDC_GCR_PCPOL;   // synch signal polarity setting
    // hsync and vsync
    LTDC->SSCR = ((h_sync                                           - 1) << 16) | (v_sync                                           - 1);
    // accumulated horizonal and vertical back porch
    LTDC->BPCR = ((h_sync + h_back_porch                            - 1) << 16) | (v_sync + v_back_porch                            - 1);
    // accumulated active width and height
    LTDC->AWCR = ((h_sync + h_back_porch + h_active                 - 1) << 16) | (v_sync + v_back_porch + v_active                 - 1);
    // accumulated total width and height
    LTDC->TWCR = ((h_sync + h_back_porch + h_active + h_front_porch - 1) << 16) | (v_sync + v_back_porch + v_active + v_front_porch - 1);

    // enable ltdc transfer and fifo underrun error interrupts
//    LTDC->IER = LTDC_IT_TE | LTDC_IT_FU;

    // configure ltdc layer
    LTDC_Layer1->WHPCR &= ~(LTDC_LxWHPCR_WHSTPOS | LTDC_LxWHPCR_WHSPPOS);
    LTDC_Layer1->WHPCR = ((0 + ((LTDC->BPCR & LTDC_BPCR_AHBP) >> 16U) + 1U) | ((320 + ((LTDC->BPCR & LTDC_BPCR_AHBP) >> 16U)) << 16U));
    LTDC_Layer1->WVPCR &= ~(LTDC_LxWVPCR_WVSTPOS | LTDC_LxWVPCR_WVSPPOS);
    LTDC_Layer1->WVPCR  = ((0 + (LTDC->BPCR & LTDC_BPCR_AVBP) + 1U) | ((240 + (LTDC->BPCR & LTDC_BPCR_AVBP)) << 16U));
    LTDC_Layer1->PFCR   = LTDC_PIXEL_FORMAT_RGB565;
    LTDC_Layer1->DCCR   = 0x000000FF;    // layer default color (back, 100% alpha)
    LTDC_Layer1->CFBAR  = (uint32_t)&__ltdc_start;  // frame buffer start address
    LTDC_Layer1->CFBLR  = ((320 * 2) << LTDC_LxCFBLR_CFBP_Pos) | (((320 * 2) + 7) << LTDC_LxCFBLR_CFBLL_Pos);  // frame buffer line length and pitch
    LTDC_Layer1->CFBLNR = 240;            // line count
    LTDC_Layer1->CACR   = 255;            // alpha
    LTDC_Layer1->CR    |= LTDC_LxCR_LEN;  // enable layer

    // reload shadow registers
    LTDC->SRCR = 0;//LTDC_SRCR_IMR;

    // enable LTDC
    LTDC->GCR |= LTDC_GCR_LTDCEN;
    LTDC->BCCR = 0x000000FF;

Note: Please note that the above development is to be done on custom hardware.

Let me know if i am missing anything.
[moderator action: added code tags]
 
Last edited by a moderator:

Hi,

I guess you mix some things:

ST7272A is no TFT display module. Instead it is the display driver (IC)

LTDC also is a display controller built in STM32 microcontroller.
It makes no sense to use both display controller at the same time.

***
So either use a TFT display including display ST7272 controller --- interfaced to STM32xx via SPI
or
use a TFT display with a LTDC interface and use the STM32 inside LCD controller

(At least this is just what I understood on a quick view)

Klaus
 

Hi Klaus,

Thanks for the clarification.
As of now i am using this:
So either use a TFT display including display ST7272 controller --- interfaced to STM32xx via SPI

My connection are STM32 <-> 24 bit RGB to TFT display and
STM32 <-> SCK, MOSI, CS of TFT display.
Please let me know how and when to use RGB and SPI communication.
 

Hi,

I can only repeat: ST7272 is the driver IC,.
But I asked for the datasheet of your display.

Klaus
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top