AnsweredAssumed Answered

SSD1289 TFT Controller Interface and FMC banks

Question asked by Elsayed.Amr on Sep 17, 2016
Latest reply on Sep 21, 2016 by FTITI.Walid
Hi Everyone,
I am interfacing an ssd1289 TFT controller with stm32f427 , I have an old code with stm32f407 and standard peripheral library , I tried to use stm32f4cube helloworld example to run my first demo on the stm32f427 processor with using HAL libraries.
While trying porting example running on an stm32f407 processor to stm32f427 one.
first I changed all FSMC to FMC , then I changed the address of writing
to be
#define  LCD_BASE_Data               ((u32)(0x60000000|0x00100000))
#define  LCD_BASE_Addr               ((u32)(0x60000000|0x00000000))
#define  LCD_CMD                     (*(vu16 *)LCD_BASE_Addr)
#define  LCD_Data                    (*(vu16 *)LCD_BASE_Data)

I changed the FMC  memory Bank to 1 as I am using addresses in that location and the old code of the
stm32f407 was using Bank 1 too , But the weird thing is that it didn't work untill I changed the bank number back to 3. then it worked and I saw the Hello world string on the blank screen.
My question is how this is happening , I commented the FMC_BANK3_BASE
//#define FMC_BANK3_BASE  ((uint32_t)(0x60000000 | 0x08000000))

and also changed the LCD write and read to use the LCD_CMD and LCD_Data addresses instead.
static void LcdWriteReg(U16 Data)
{
//  STM_FMC_BANK3_WriteReg(Data);
    LCD_CMD = Data;
}
static void LcdWriteData(U16 Data)
{
//  STM_FMC_BANK3_WriteData (Data);
    LCD_Data = Data;
}
static void LcdWriteDataMultiple(U16 * pData, int NumItems)
{
  while (NumItems--)
  {
//    STM_FMC_BANK3_WriteData(*pData++);
        LcdWriteData (*pData++);
  }
}
static void LcdReadDataMultiple(U16 * pData, int NumItems)
{
  while (NumItems--)
  {
//    *pData++ = STM_FMC_BANK3_ReadData();
  }
}

so please if you can give me some explanation how setting the FMC bank to 3 work with address from bank one ?
Thanks a lot,
Amr.

Outcomes