2016-12-08 10:01 AM
So I finally got my IL9325 TFT display running via FMC but it is running much slower than I expected. The SPI based displays on arduinos seem to be performing better than this parallel setup. I measured my data pulse width to be around 20us. Is this the limit of the FMC(settings below)? I am running my clock at 168Mhz, HSE=24Mhz M = 12, N = 168 , P = 2, Q = 7, AHB =1, APB1 = 4, APB2 = 2. If the FMC should be running faster, what should I be looking into?
FMC_NORSRAMTimingInitStructure.FMC_AddressSetupTime = 15; /* Address Setup Time */ FMC_NORSRAMTimingInitStructure.FMC_AddressHoldTime = 0; FMC_NORSRAMTimingInitStructure.FMC_DataSetupTime = 15; /* Data Setup Time */ FMC_NORSRAMTimingInitStructure.FMC_BusTurnAroundDuration = 0; FMC_NORSRAMTimingInitStructure.FMC_CLKDivision = 0; FMC_NORSRAMTimingInitStructure.FMC_DataLatency = 0; FMC_NORSRAMTimingInitStructure.FMC_AccessMode = FMC_AccessMode_A; /* FSMC Access Mode */ FMC_NORSRAMInitStructure.FMC_Bank = FMC_Bank1_NORSRAM4; FMC_NORSRAMInitStructure.FMC_DataAddressMux = FMC_DataAddressMux_Disable; FMC_NORSRAMInitStructure.FMC_MemoryType = FMC_MemoryType_SRAM; FMC_NORSRAMInitStructure.FMC_MemoryDataWidth = FMC_NORSRAM_MemoryDataWidth_16b; FMC_NORSRAMInitStructure.FMC_BurstAccessMode = FMC_BurstAccessMode_Disable; FMC_NORSRAMInitStructure.FMC_WaitSignalPolarity = FMC_WaitSignalPolarity_Low; FMC_NORSRAMInitStructure.FMC_WrapMode = FMC_WrapMode_Disable; FMC_NORSRAMInitStructure.FMC_WaitSignalActive = FMC_WaitSignalActive_BeforeWaitState; FMC_NORSRAMInitStructure.FMC_WriteOperation = FMC_WriteOperation_Enable; FMC_NORSRAMInitStructure.FMC_WaitSignal = FMC_WaitSignal_Disable; FMC_NORSRAMInitStructure.FMC_AsynchronousWait = FMC_AsynchronousWait_Disable; FMC_NORSRAMInitStructure.FMC_ExtendedMode = FMC_ExtendedMode_Disable; FMC_NORSRAMInitStructure.FMC_WriteBurst = FMC_WriteBurst_Disable; FMC_NORSRAMInitStructure.FMC_ReadWriteTimingStruct = &FMC_NORSRAMTimingInitStructure; FMC_NORSRAMInit(&FMC_NORSRAMInitStructure); /* FSMC Write Timing */ FMC_NORSRAMTimingInitStructure.FMC_AddressSetupTime = 5;//2;//1; /* Address Setup Time */ FMC_NORSRAMTimingInitStructure.FMC_AddressHoldTime = 0; FMC_NORSRAMTimingInitStructure.FMC_DataSetupTime = 5;//2;//1; /* Data Setup Time */ FMC_NORSRAMTimingInitStructure.FMC_BusTurnAroundDuration = 0x00; FMC_NORSRAMTimingInitStructure.FMC_CLKDivision = 0; FMC_NORSRAMTimingInitStructure.FMC_DataLatency = 0x00; FMC_NORSRAMTimingInitStructure.FMC_AccessMode = FMC_AccessMode_A; /* FSMC Access Mode */ FMC_NORSRAMInitStructure.FMC_WriteTimingStruct = &FMC_NORSRAMTimingInitStructure; FMC_NORSRAMInit(&FMC_NORSRAMInitStructure);�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
#fmc #stm32f429/39 #fmc-speed #fmc-setup
Note: this post was migrated and contained many threaded conversations, some content may be missing.
2016-12-08 03:29 PM
I still don' quite understand what do we see on those screenshots.Data lines are not the best for viewing, especially if you output the same data all the time. Scope the write/chipselect lines.
If this is one of the data lines, why is its amplitude around 2.2V? Is your power supply around 2.2V? And why is the plateau at 1V? Is your probe capable of capturing cca 100MHz signals? Can't this be an aliased view of the signal? What happens if you switch the time scale of scope to 100ns/div or less?
Also, did you prove that SYSCLK is 168MHz, by outputting it to MCO and scoping it, or any other means?
JW
2016-12-08 03:48 PM
Yes I posted above, Sysclk/2 = ~84Mhz. Its a tiny bit off but i think thats ok.
It is exactly 3.31v on high. I should have put the markers my bad.. Each pulse should represent a 1 since I am continually writing 1's to the data bits. I am in the middle of generating a HAL based version to test FMC out.
My probes and rigol are rated for 100Mhz. At 100ns/div TS, its just a flat hi or low.
2016-12-08 04:47 PM
Ah now I see your post saying MCO set to SYSCLK/2 measures 3MHz. Sorry I overlooked that.
The screenshot says 1V/div and the signal's max is somewhat above 2 divs counted from indicated zero on the second screenshot. My understanding of scopes says it's around 2.2V then.
If you continually write 1s, why would the data go to 0 at all? Write an alternating pattern, 0s and 1s. That still won't show you the actual write duration - that's why you need to look at the write and chipselect signals.
JW
2016-12-08 04:50 PM
So your scope vertical channel amps have a VAR and a CAL position and you weren't in CAL ?
2 vertical division up from the REF mark and 1V per division is what I see too.... ?
2016-12-08 05:34 PM
Ok. As promised here is a HAL progress update on testing FMC. Apparently my RS signal (A18 or PD13) doesn't work in when auto configured by Cube. Toggling the bit manually yielded proper communications with the TFT and I was able to read out the ID. Rather than 22us, i am now measuring pulses between 60-200ns which is what I had hoped for. Thanks again to everyone in helping me out.
I will start to migrate my bare bones LCD code to test the clear screen function and check it out. I guess the answer was, Why aren't you using HAL? And potentially my clock settings are messed up even tho MCO readouts are good.
Here are a few captures of FMC running with HAL and the FMC timings.
Timing.AddressSetupTime = 6;
Timing.AddressHoldTime = 0; Timing.DataSetupTime = 11; Timing.BusTurnAroundDuration = 0; Timing.CLKDivision = 0; Timing.DataLatency = 0; Timing.AccessMode = FMC_ACCESS_MODE_A;D2 Signal
RS
RD
WR
2016-12-09 07:29 AM
Now ALL those look better. Hopefully a nearer done deal. That earlier scope shot was where HAL, SPL and BARE BONES were all duken' it out in one compile. They never get along well. :\
Oh and CubeMX too of course...
2016-12-09 09:43 AM
Hey lampii,
great news! Well, I don't think the answer is why don't you use HAL, however sometimes using CubeMX just to make sure your setup is running and than porting it to your library etc. is faster. :)
Good luck with future development!
Renegade
2018-11-12 01:23 AM
can you please share the source code..