2024-11-08 11:12 AM - last edited on 2024-11-08 11:20 AM by SofLit
there is nothing on github.
there is initialization by SPI before the LTDC works
is there a sequence like you initialize it first over SPI then
MX_LTDC_Init() or it does not matter
I do have the initialization code but I am missing something
void SLGDP4571_Int(void)
{
SPI_WriteComm(0x20);
SPI_WriteComm(0x3A);
SPI_WriteData(0x70);
SPI_WriteComm(0xB1);
SPI_WriteData(0x10);
SPI_WriteData(0x14);
SPI_WriteData(0x06);
SPI_WriteComm(0xB2);
SPI_WriteData(0x00);
SPI_WriteData(0xC8);
SPI_WriteComm(0xB3);
SPI_WriteData(0x11);
SPI_WriteData(0xFF);
SPI_WriteComm(0xB4);
SPI_WriteData(0x10);
SPI_WriteComm(0xB6);
SPI_WriteData(0x08);
SPI_WriteData(0x18);
SPI_WriteData(0x02);
SPI_WriteData(0x40);
SPI_WriteData(0x10);
SPI_WriteComm(0xB7);
SPI_WriteData(0x00);
SPI_WriteData(0x10);
SPI_WriteData(0x01);
SPI_WriteComm(0xC3);
SPI_WriteData(0x04);
SPI_WriteData(0x05);
SPI_WriteData(0x04);
SPI_WriteData(0x04);
SPI_WriteData(0x01);
SPI_WriteComm(0xC4);
SPI_WriteData(0x22);
SPI_WriteData(0x03);
SPI_WriteData(0x00);
SPI_WriteData(0x1A);
SPI_WriteData(0x1A);
SPI_WriteData(0x05);
SPI_WriteData(0x00);
SPI_WriteData(0x04);
SPI_WriteComm(0xC5);
SPI_WriteData(0x6C);
SPI_WriteComm(0xC6);
SPI_WriteData(0x23);
/****
SPI_WriteComm(0xC8);
SPI_WriteData(0x01);
SPI_WriteData(0x01);
SPI_WriteData(0x03);
SPI_WriteData(0xFF);
***/
SPI_WriteComm(0xD0);
SPI_WriteData(0x00);
SPI_WriteData(0x43);
SPI_WriteData(0x64);
SPI_WriteData(0x25);
SPI_WriteData(0x10);
SPI_WriteData(0x02);
SPI_WriteData(0x71);
SPI_WriteData(0x44);
SPI_WriteData(0x04);
SPI_WriteComm(0xD1);
SPI_WriteData(0x00);
SPI_WriteData(0x43);
SPI_WriteData(0x64);
SPI_WriteData(0x25);
SPI_WriteData(0x10);
SPI_WriteData(0x02);
SPI_WriteData(0x71);
SPI_WriteData(0x44);
SPI_WriteData(0x04);
SPI_WriteComm(0xD2);
SPI_WriteData(0x00);
SPI_WriteData(0x43);
SPI_WriteData(0x64);
SPI_WriteData(0x25);
SPI_WriteData(0x10);
SPI_WriteData(0x02);
SPI_WriteData(0x71);
SPI_WriteData(0x44);
SPI_WriteData(0x04);
SPI_WriteComm(0xD3);
SPI_WriteData(0x00);
SPI_WriteData(0x43);
SPI_WriteData(0x64);
SPI_WriteData(0x25);
SPI_WriteData(0x10);
SPI_WriteData(0x02);
SPI_WriteData(0x71);
SPI_WriteData(0x44);
SPI_WriteData(0x04);
SPI_WriteComm(0xC2);
SPI_WriteData(0x08);
HAL_Delay(20);
SPI_WriteComm(0xC2);
SPI_WriteData(0x18);
HAL_Delay(20);
SPI_WriteComm(0xC2);
SPI_WriteData(0xB8);
HAL_Delay(20);
SPI_WriteComm(0xB5);
SPI_WriteData(0x01);
HAL_Delay(20);
SPI_WriteComm(0x29);
HAL_Delay(20);
}
Solved! Go to Solution.
2024-11-09 07:19 AM - edited 2024-11-09 07:22 AM
This is not the first time I am having problem to send data over SPI, that was the problem again.
You would have to see on logic analyzer to compare the waves.
So I disabled SPI and assigned PINs as output. And I made my own SPI interface using pins as output. And it worked fine, the display is initializing and working.
void SPI_SendData(unsigned char i)
{
unsigned char n;
for(n=0; n<8; n++)
{
if(i&0x80) HAL_GPIO_WritePin(GPIOI, GPIO_PIN_3, GPIO_PIN_SET);
else HAL_GPIO_WritePin(GPIOI, GPIO_PIN_3, GPIO_PIN_RESET);
i<<= 1;
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_RESET);//_nop_(); _nop_();_nop_();_nop_();
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_SET);//_nop_();_nop_();_nop_();_nop_();
}
}
If somebody has similar problem with initialization over SPI does not work that might be the solution.
Maybe somebody from STM can collaborate?
2024-11-08 11:22 AM
2024-11-09 07:19 AM - edited 2024-11-09 07:22 AM
This is not the first time I am having problem to send data over SPI, that was the problem again.
You would have to see on logic analyzer to compare the waves.
So I disabled SPI and assigned PINs as output. And I made my own SPI interface using pins as output. And it worked fine, the display is initializing and working.
void SPI_SendData(unsigned char i)
{
unsigned char n;
for(n=0; n<8; n++)
{
if(i&0x80) HAL_GPIO_WritePin(GPIOI, GPIO_PIN_3, GPIO_PIN_SET);
else HAL_GPIO_WritePin(GPIOI, GPIO_PIN_3, GPIO_PIN_RESET);
i<<= 1;
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_RESET);//_nop_(); _nop_();_nop_();_nop_();
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_SET);//_nop_();_nop_();_nop_();_nop_();
}
}
If somebody has similar problem with initialization over SPI does not work that might be the solution.
Maybe somebody from STM can collaborate?
2024-11-09 08:20 AM
>>Maybe somebody from STM can collaborate?
Work with your account's FAE (support enginer), or other engineers on your team.
>>If somebody has similar problem with initialization over SPI does not work that might be the solution.
Probably timing or edge/phase configuration issues.
Check controller data sheet about expectations for CS, and data timing expectations.
2024-11-09 09:54 AM - edited 2024-11-09 09:55 AM
This is how it looks now