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 12:47 PM
Well, this is strange, when I set my crystal to 24 MHz, select HSE as my clock source and set 180 into the box for Core clock, CubeMX calculates all the prescaler values properly. Not sure whether you are using other peripherals...
Well, HAL isn't that difficult. However if you insist on SPL, you don't need to use HAL after you make the project running with it. You just use it as a template... sometimes the code contains lines, which are not obvious from the documentation or are completely missing and the only persons who knows are from ST...
Renegade
2016-12-08 12:52 PM
Can you provide the datasheet of your memory?
Renegade
2016-12-08 12:54 PM
Yes that was odd. I just remade an identical project in CubeMX, gave the same values and it generated a set for 180.
Previously
I was getting the 180Mhz config could not be found, would you like to use 168Mhz instead?Actually, It is because I also have USB_OTG_FS selected in my configuration which I plan to be making into a VCOM port.
2016-12-08 01:03 PM
The data sheet to the TFT controller is here.
http://www.hpinfotech.ro/ILI9325.pdf
The purchased TFT is this one:
http://www.waveshare.com/product/modules/oleds-lcds/graphic-lcd/3.2inch-320x240-touch-lcd-c.htm
2016-12-08 01:14 PM
lampii,
How did you verify the system clock frequency? Output to MCO pin and measured with oscilloscope?
What exactly do you mean by 'data pulse' and how did you measure it?
Clive,
I don't SPL but IMO FMC_ExtendedMode_Disable means FMC_BCR.EXTMOD = 0, i.e. FMC_BWTR (the write timing) is ignored.
2016-12-08 01:35 PM
Correct, I enabled MC01 and MC02 and went through each of the clocks.
Here is a screen cap of the Oscilloscope measuring one of the data lines. Here the code is set to write 0xFFFF without delays in an infinite loop.
2016-12-08 01:45 PM
I've made some research and taking a look into the application note AN2790 according to my calculations the AddressSetupTime should be 6 min and the DataSetupTime 11 min if running at 168 MHz. Also the access mode should be MODE_B (but here I'm not really sure). Use cube and have a look whether it works or not... afterwards you can adjust your SPL app.
I don't think this will help, but who knows... maybe wrong timing can cause these issues. As Jan said, what do you mean by 'data pulse' and how do you measure it?
Just out of curiousity, why don't you use the LTDC peripheral instead? :)
Good luck,
Renegade
2016-12-08 02:27 PM
Ohh hehe i meant just the LCD stuff. The rest of the project is pretty minimal since its just a systems check for all my features. I will chime back in later with what happens.
2016-12-08 02:57 PM
I will try and port the project to HAL tonight and see. Thanks for taking a look into my issue. I really appreciate it.
I posted screen captures of the oscilloscope measuring the data pin above to show what I meant.This panel does not provide the necessary sync and clock pins for the RGB interface.
I am working on another design for a new panel which will use the LTDC peripheral and perhaps some SDRAM.2016-12-08 03:13 PM
Don't port anything to HAL, just generate a new project using CubeMX and try to paint something on the LCD to see, whether it works as intended. No reason to port the whole project imho. :)
Renegade