This post was last edited by fdsf on 2018-12-21 13:06 The 2.8-inch TFTLCD screen not only cannot display, but also the backlight cannot work. The backlight driver is in the LCD initialization code. I have pasted some important codes and I sincerely ask the big guys to help me review them. I have been searching for several days but still can’t find them. I began to suspect that it is a problem with the hardware. Thank you very much! ! ! I am using NE1, the address line is A16, The base address is set to: #define LCD_BASE ((u32)(0x60000000 | 0x0001FFFE)) #define LCD ((LCD_TypeDef *) LCD_BASE) PE1 port connected to LCD backlight PD7 connected to LCD_CS PD11 connected to LCD_RS Other settings are exactly the same as Atom Brother's template FSMC initialization configuration is as follows: GPIO_InitTypeDef GPIO_InitStructure; FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure; FSMC_NORSRAMTimingInitTypeDef readWriteTiming; FSMC_NORSRAMTimingInitTypeDef writeTiming; RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC,ENABLE); //Enable FSMC clock RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOE|RCC_APB2Periph_GPIOD, ENABLE);//Enable PORTE, PORTD GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; //PE1 push-pull output backlight GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //Push-pull output GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOE,&GPIO_InitStructure);
readWriteTiming.FSMC_AddressSetupTime = 0x01; //地址建立时间(ADDSET)为2个HCLK 1/36M=27ns
readWriteTiming.FSMC_AddressHoldTime = 0x00; //Address hold time (ADDHLD) mode A is not used readWriteTiming.FSMC_DataSetupTime = 0x0f; //The data retention time is 16 HCLKs, because the LCD driver IC cannot read data too fast, especially for the 1289 IC. readWriteTiming.FSMC_BusTurnAroundDuration = 0x00; readWriteTiming.FSMC_CLKDivision = 0x00; readWriteTiming.FSMC_DataLatency = 0x00; readWriteTiming.FSMC_AccessMode = FSMC_AccessMode_A; //Mode A writeTiming.FSMC_AddressSetupTime = 0x00; //Address setup time (ADDSET) is 1 HCLK writeTiming.FSMC_AddressHoldTime = 0x00; //Address hold time (A writeTiming.FSMC_DataSetupTime = 0x03; ////The data saving time is 4 HCLKs writeTiming.FSMC_BusTurnAroundDuration = 0x00; writeTiming.FSMC_CLKDivision = 0x00; writeTiming.FSMC_DataLatency = 0x00; writeTiming.FSMC_AccessMode = FSMC_AccessMode_A; //Mode A FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;// Here we use NE1. FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; // Do not reuse data addresses FSMC_NORSRAMInitStructure.FSMC_MemoryType =FSMC_MemoryType_SRAM;// FSMC_MemoryType_SRAM; //SRAM FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;//The memory data width is 16bit FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode =FSMC_BurstAccessMode_Disable;// FSMC_BurstAccessMode_Disable; FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low; FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait=FSMC_AsynchronousWait_Disable;
FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable; // 存储器写使能
FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Enable; // 读写使用不同的时序
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &readWriteTiming; //读写时序
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &writeTiming; //写时序
Your question is quite big. Are you sure the MCU you are using is STM32F103VB? If so, then this is a medium-density product and does not have a FSMC bus.
Details
Published on 2018-12-21 15:48
Have you done anything in the PE1 code? You only posted the initialization code. Generally, fsmc is fine. If you still have questions, please post the complete code and hardware.
PE1 can be configured separately, but it does not work when it is configured in LCD_Init(). I will upload the schematic diagram and all the codes later.
Details
Published on 2018-12-21 13:02
Sodium Citrate posted on 2018-12-21 12:55 Have you done anything in the PE1 code? You only posted the initialization code, which is usually fine for fsmc. If you still have questions, please post the complete code and hardware.
If you take PE1 out and configure it separately, it can be operated, but if you configure it in LCD_Init(), it will not work. I will package the schematic diagram and all the codes later.
Your question is quite big. Are you sure the MCU you are using is STM32F103VB? If so, then this is a medium-density product and does not have a FSMC bus.
It is STM32F103VB. I was wondering if there is FSMC bus before. Now that you said that, I don't know. But thank you anyway.
Details
Published on 2018-12-21 16:49
It is STM32F103VB. I was wondering if there is FSMC bus before. Now that you said that, I don't know. But thank you anyway.
Details
Published on 2018-12-21 16:22
gs001588 posted on 2018-12-21 15:48 Your question is quite big. Are you sure the MCU you use is STM32F103VB? If so, then this is a medium-density product and does not have a FSMC bus.
It is indeed STM32F103VB. . . . I was wondering whether there is a FSMC bus before, but after you said that, oh. But thank you anyway.
gs001588 posted on 2018-12-21 15:48 Your question is quite big. Are you sure the MCU you are using is STM32F103VB? If so, then this is a medium-density product without FSMC bus.
If you change the MCU to STM32F103VET6, can you still operate it with NE1 of Bank1?