AnsweredAssumed Answered

STM32F429 FMC + SSD1963 + Clock Speed

Question asked by gillott.matt on May 14, 2015
Latest reply on May 14, 2015 by raggini.davide
I'm quite new into the STM32 devices, so apologies in advance for the scrappy code!
I've got a STM32F429 Discovery board attached to a SSD1963 display though the FMC (8 bit mode at the moment), however I cant seem to get the display working when the micro is running at full speed.
If I have the PLL-P set to /4 so the HCLK is 84MHz then the display works fine with the settings shown in the code below.
If I set the PLL-P to /2 to run HCLK at 168MHz then I can't find a timing that works correctly.  If I view the signals with a logic probe they look ok but the display doesn't want to respond, so I'm guessing there's something not quite set correctly.  I've tried quite a few different settings for the timing but none seem to work at 168MHz
From the data sheet the FMC runs from the HCLK clock, meaning it has to run at the same speed as the core, so I presume that its just my FMC timing structure that's incorrect.

The initialisation code has been generated using the STM32CubeMX utility.

System Clock Init:
  RCC_OscInitTypeDef RCC_OscInitStruct;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;



  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLM = 8;
  RCC_OscInitStruct.PLL.PLLN = 336;
  RCC_OscInitStruct.PLL.PLLQ = 7;

  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
  HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); //LATENCY_5 for 168MHz

FMC Init for display interface:
  hsram1.Instance = FMC_NORSRAM_DEVICE;
  //hsram1.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
  /* hsram1.Init */
  hsram1.Init.NSBank = FMC_NORSRAM_BANK1;
  hsram1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE;
  hsram1.Init.MemoryType = FMC_MEMORY_TYPE_SRAM;
  hsram1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_8;
  hsram1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE;
  hsram1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
  hsram1.Init.WrapMode = FMC_WRAP_MODE_DISABLE;
  hsram1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS;
  hsram1.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE;
  hsram1.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE;
  hsram1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE;
  hsram1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_DISABLE;
  hsram1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE;
  hsram1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ONLY;
  /* Timing */
  Timing.AddressSetupTime = 2;
  Timing.AddressHoldTime = 0;
  Timing.DataSetupTime = 2;
  Timing.BusTurnAroundDuration = 0;
  Timing.CLKDivision = 0;
  Timing.DataLatency = 0;
  Timing.AccessMode = FMC_ACCESS_MODE_A;
  /* ExtTiming */

  HAL_SRAM_Init(&hsram1, &Timing, &Timing);    
    FMC_SDRAM_TimingTypeDef SdramTiming;

Any suggestions to get this working with the micro at 168MHz would be very much appreciated thanks!