cancel
Showing results for 
Search instead for 
Did you mean: 

fsmc timing problem

elec_st
Associate III

fsmc timing problem

hello my lcd need the ne1 pin in stm32 to be >= 500ns but i see i oscilloscope it's 124ns . i need to make it >= 500ns for my lcd cs pin

 i want to make NE1 high pulse width more than 500ns

 here is my timing code

  hsram1.Instance = FSMC_NORSRAM_DEVICE;
  hsram1.Extended = FSMC_NORSRAM_EXTENDED_DEVICE;
  /* hsram1.Init */
  hsram1.Init.NSBank = FSMC_NORSRAM_BANK1;
  hsram1.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE;
 
  hsram1.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM;
  hsram1.Init.MemoryDataWidth = FSMC_NORSRAM_MEM_BUS_WIDTH_16;
  hsram1.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE;
  hsram1.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW;
  hsram1.Init.WrapMode = FSMC_WRAP_MODE_DISABLE;
  hsram1.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS;
  hsram1.Init.WriteOperation = FSMC_WRITE_OPERATION_ENABLE;
  hsram1.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE;
  hsram1.Init.ExtendedMode = FSMC_EXTENDED_MODE_DISABLE;
  hsram1.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE;
  hsram1.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE;
  /* Timing */
  Timing.AddressSetupTime = 15;
  Timing.AddressHoldTime = 15;
  Timing.DataSetupTime = 15;
  Timing.BusTurnAroundDuration = 15;
  Timing.CLKDivision = 15;
  Timing.DataLatency = 15;
  Timing.AccessMode = FSMC_ACCESS_MODE_A;
  /* ExtTiming */
 
  if (HAL_SRAM_Init(&hsram1, &Timing, NULL) != HAL_OK)

 here is my oscilloscope screen shoot

4 REPLIES 4
turboscrew
Senior III

Why do you need the NE1 high to be that long? You know the signal is normally active low? (That's why the "n" in the beginning of the name.)

You can stretch it by increasing the bus turnaround.

 Another way is not to access the LCD so often.

elec_st
Associate III

thank you i need NE1 to be long high because my lcd need this here s my lcd

0690X000006Cvv7QAC.png

here is my lcd i use stemin and numpad widget example not showing correct

0690X000006CvvRQAS.jpg

turboscrew
Senior III

Ok. Then the two ways (maybe combined) is the way to go. There can be at most one read access per microsecond - and that's quite long time, but you can't avoid it, if you need to draw stuff in layers and you don't have enough RAM for frame buffer.

If you are using Chrom-Art you might want to check the DT-field of the DMA2D_AMTCR register too...

It might be possible to use synchronous single transfer bursts without the clock. Then you could use clock divider too. Not sure about that, though. I've only been playing with FMC. I run into problems with too short hold time (my LCD needs 10 ns), so I had to figure out how to use NAND interface instead.

It looks like with LCDs you often need to get creative... :D

elec_st
Associate III

thank you 😍