cancel
Showing results for 
Search instead for 
Did you mean: 

TFT display interfacing problem with STM32FRE having SSD1963 graphicscontroller

ykn
Senior

hi ,

i tried to interface TFT display 800X480 with stm32f401re. TFT display interface with SSD1963.

now the thing is that display does not showing anything .

i dont know the problem with initialization process or else.

the pin mainly used RS#, CS#.WR#, RST, RD# and 0-15 data pin . please go through the below pragamm suggest me where i am wrong . for initialization process of PIN i used STMcubeMX.

void Write_Command(unsigned char command) {
    HAL_GPIO_WritePin(GPIOC, GPIO_CS_Pin, 0);	
	   
	
    HAL_GPIO_WritePin(GPIOC, GPIO_RD_Pin, 1);        /* make sure the RD  is HIGH just to be sure */
    HAL_GPIO_WritePin(GPIOC, GPIO_RS_Pin, 0);       
    HAL_GPIO_WritePin(GPIOC, GPIO_WR_Pin, 0); 
    HAL_Delay(1);
    
	  GPIOA->ODR = command;
    
    HAL_Delay(1);
    HAL_GPIO_WritePin(GPIOC, GPIO_WR_Pin, 1);         
    HAL_GPIO_WritePin(GPIOC, GPIO_CS_Pin, 1);         
 
}
 
void Write_Data(unsigned char Data) {
	      HAL_GPIO_WritePin(GPIOC, GPIO_CS_Pin, 0); 	
      
    HAL_GPIO_WritePin(GPIOC, GPIO_RD_Pin, 1);        /* make sure the RD  is HIGH just to be sure */
    HAL_GPIO_WritePin(GPIOC, GPIO_RS_Pin, 1);       
    HAL_GPIO_WritePin(GPIOC, GPIO_WR_Pin, 0);
    HAL_Delay(1);
    
	  GPIOA->ODR = Data;
    
    HAL_Delay(1);
    HAL_GPIO_WritePin(GPIOC, GPIO_WR_Pin, 1);         
    HAL_GPIO_WritePin(GPIOC, GPIO_CS_Pin, 1);         
 
}
void Command_Write(unsigned char REG,unsigned char VALUE) {
    Write_Command(REG);
    Write_Data(VALUE);
}
 
static void MX_GPIO_Init(void)
{
  GPIO_InitTypeDef GPIO_InitStruct = {0};
 
  /* GPIO Ports Clock Enable */
  __HAL_RCC_GPIOC_CLK_ENABLE();
  __HAL_RCC_GPIOA_CLK_ENABLE();
 
  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOC, GPIO_RST_Pin|GPIO_CS_Pin|GPIO_RS_Pin|GPIO_RD_Pin 
                          |GPIO_WR_Pin, GPIO_PIN_RESET);
 
  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3 
                          |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7 
                          |GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11 
                          |GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);
 
  /*Configure GPIO pins : GPIO_RST_Pin GPIO_CS_Pin GPIO_RS_Pin GPIO_RD_Pin 
                           GPIO_WR_Pin */
  GPIO_InitStruct.Pin = GPIO_RST_Pin|GPIO_CS_Pin|GPIO_RS_Pin|GPIO_RD_Pin 
                          |GPIO_WR_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
 
  /*Configure GPIO pins : PA0 PA1 PA2 PA3 
                           PA4 PA5 PA6 PA7 
                           PA8 PA9 PA10 PA11 
                           PA12 PA13 PA14 PA15 */
  GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3 
                          |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7 
                          |GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11 
                          |GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_PULLDOWN;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
 
}
void begin()
{
HAL_GPIO_WritePin(GPIOA, GPIO_RST_Pin, 0);
     __NOP;
	   __NOP;
	   __NOP;
    
  HAL_GPIO_WritePin(GPIOA , GPIO_RST_Pin, 1);
      __NOP;   __NOP;   __NOP;
	
   Write_Command(0x01); //Software Reset
   Write_Command(0x01);
   Write_Command(0x01);
   Command_Write(0xe0,0x01); // START PLL
   Command_Write(0xe0,0x03); // LOCK PLL
   Write_Command(0xb0); //SET LCD MODE SET TFT 18Bits MODE
   Write_Data(0x08); //SET TFT MODE & hsync+Vsync+DEN MODE
	Write_Data(0x80); //SET TFT MODE & hsync+Vsync+DEN MODE
	Write_Data(0x03); //SET horizontal size=800-1 HightByte
	Write_Data(0x1f); //SET horizontal size=800-1 LowByte
	Write_Data(0x01); //SET vertical size=480-1 HightByte
	Write_Data(0xdf); //SET vertical size=480-1 LowByte
	Write_Data(0x00); //SET even/odd line RGB seq.=RGB
	Command_Write(0xf0,0x00); //SET pixel data I/F format=8bit
	Command_Write(0x3a,0x60); // SET R G B format = 6 6 6
	Write_Command(0xe2); //SET PLL freq=113.33MHz ;
	Write_Data(0x22);
	Write_Data(0x03);
	Write_Data(0x04);
	Write_Command(0xe6); //SET PCLK freq=33.26MHz ; pixel clock frequency
	Write_Data(0x00);
	Write_Data(0xe7);
	Write_Data(0x4f);
	Write_Command(0xb4); //SET HBP,
	Write_Data(0x20); //SET HSYNC Total = 8367
	Write_Data(0xaf);
	Write_Data(0x00); //SET HBP = 163
	Write_Data(0xa3); 
 
	Write_Data(0x07); //SET VBP 8 = 7 + 1
	Write_Data(0x00); //SET Hsync pulse start position
	Write_Data(0x00);
	Write_Data(0x00); //SET Hsync pulse subpixel start position
	Write_Command(0xb6); //SET VBP,
	Write_Data(0x01); //SET Vsync total 496 = 495 + 1
	Write_Data(0xef);
	Write_Data(0x00); //SET VBP = 4
	Write_Data(0x04);
	Write_Data(0x01); //SET Vsync pulse 2 = 1 + 1
	Write_Data(0x00); //SET Vsync pulse start position
	Write_Data(0x00);
	Write_Command(0x2a); //SET column address
	Write_Data(0x00); //SET start column address=0
	Write_Data(0x00);
	Write_Data(0x03); //SET end column address=800
	Write_Data(0x1f);
	Write_Command(0x2b); //SET page address
	Write_Data(0x00); //SET start page address=0
	Write_Data(0x00);
	Write_Data(0x01); //SET end page address=480
	Write_Data(0xdf);
	Write_Command(0x29); //SET display on
	Write_Command(0x2c);
}

thanking you

10 REPLIES 10

Observe the pins using a logic analyzer.

JW

Trevor Jones
Senior

make sure the back light is running, so if there is some display you can see it.

Yes you need to scope the RS, R/W and CS pins at least...

ykn
Senior

display is powered up by 3.3v supply, is it enough to back light on.

or you have to ON it by Command

Write_Command(0x29); //SET display on

 because there is no back light running.

my display module https://www.mikroe.com/tft-proto-5-board

You need to scope those pins mentioned above,
show us the scope waveforms
then we can help further,
I have no experience with that chip personally...

Initially All controll pin high for 50ms then Write_Command(); delay 50ms Write_data();

please see the attachement.

thanking you0690X00000AqUMfQAN.png

T J
Lead

which trace is which ?

where is the nCS pin ? RST pin ? RS pin?

you need to see all the pins...

are you sure the data pins are doing what you expect ?

You will see the issues on the scope...

I hope you have secure hook up wires and not lose connections, did you solder them in place ?

Check the power rail is correct too, did you add a capacitor on the display side of the power wires ?

a solid ground wire is necessary, a thicker wire is always a good starting point for ground.

good luck.

i checked the level of data pin, and it is according to the data. i have reset the display at the starting of main function.

TFT proto 5" is adisplay module with SSD1963 inbult controller, it has D[0-15], cs, RD, WR,RST, TE, RS pin 3.3V and GND pin for external connection with the controller.0690X00000AqWg3QAF.png

T J
Lead

those pins look good

You have to check the other pins and the startup code.

Is reset High active or low active ?

the backlight is separate from the LCD data usually,

so you should see some light somewhere,

otherwise shine a bright light on it, you have an image but no backlight.

good luck, you need to do your own discovery, if it was easy everyone would be doing it.

check your ground wire is thick, and your power is clean..

good luck.. keep working on it...

T J
Lead

I cant do your work for you... , but I can see this looks wrong,

line 47

HAL_GPIO_WritePin(GPIOC, GPIO_RST_Pin|GPIO_CS_Pin|GPIO_RS_Pin|GPIO_RD_Pin

|GPIO_WR_Pin, GPIO_PIN_RESET);

all those pins should be high on startup GPIO_PIN_SET !

in Main after the pins are initialised , wait 1mS , pull Rst# low, wait 1mS , then RST# High for a proper reset.

you need capacitance on the power cable, just 47uF or something, I cant imagine your wiring issues...

take a photo and show us...