cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F2, FSMC, SSD1963 Performance

mfranklin
Associate II
Posted on June 12, 2012 at 02:43

I've recently created a prototype with a STM32F2 and a Solomon Systech SSD1963 interfaced via the FSMC (Resolution: 800 x 480).  I've succeeded in getting things displayed on the screen, but I'm a little disappointed in performance.  (Please note that I'm only referring to the amount of time it takes to write data to the SSD1963's frame buffer from the STM32F2, not the refresh rate of the LCD).  I've only been able to get about 3 FPS and I was hoping for something in the teens. 

Are my expectations too high?  Please share your experience and offer your advice.

Here's my FSMC init code.

//--- FSMC Configuration -----------------------------------------------------

  //FSMC Initialization

  FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;

  FSMC_NORSRAMTimingInitTypeDef FSMC_NORSRAMTimingInitStructure;

 

  // Enable the FSMC Clock

  RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);

   

  FSMC_NORSRAMDeInit(FSMC_Bank1_NORSRAM1);

 

  FSMC_NORSRAMTimingInitStructure.FSMC_AddressSetupTime      = 0;     // 1ns

  FSMC_NORSRAMTimingInitStructure.FSMC_AddressHoldTime       = 1;     // 2ns

  FSMC_NORSRAMTimingInitStructure.FSMC_DataSetupTime         = 1;     // 4ns

  FSMC_NORSRAMTimingInitStructure.FSMC_AccessMode            = FSMC_AccessMode_B; //?? don't know yet

 

  FSMC_NORSRAMTimingInitStructure.FSMC_BusTurnAroundDuration = 0;     // Only used with NOR Flash

  FSMC_NORSRAMTimingInitStructure.FSMC_CLKDivision           = 1;     // Not used for Nor or SRAM

  FSMC_NORSRAMTimingInitStructure.FSMC_DataLatency           = 0;     // Don't care with Nor or SRAM

  FSMC_NORSRAMInitStructure.FSMC_Bank                  = FSMC_Bank1_NORSRAM1;

  FSMC_NORSRAMInitStructure.FSMC_MemoryType            = FSMC_MemoryType_NOR;

  FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth       = FSMC_MemoryDataWidth_16b;

  FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &FSMC_NORSRAMTimingInitStructure;

  FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct     = &FSMC_NORSRAMTimingInitStructure;

  FSMC_NORSRAMInitStructure.FSMC_WriteOperation        = FSMC_WriteOperation_Enable;

 

  FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity    = FSMC_WaitSignalPolarity_Low;           // Only valid for flash memory in burst mode (just default)

  FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive      = FSMC_WaitSignalActive_BeforeWaitState; // Only valid for burst memories (just default)

  FSMC_NORSRAMInitStructure.FSMC_WaitSignal            = FSMC_WaitSignal_Disable;               // Only valid for flash memory in burst mode (just default)

  FSMC_NORSRAMInitStructure.FSMC_ExtendedMode          = FSMC_ExtendedMode_Disable;             // Don't know yet

  FSMC_NORSRAMInitStructure.FSMC_WriteBurst            = FSMC_WriteBurst_Disable;               // Don't know yet

  FSMC_NORSRAMInitStructure.FSMC_WrapMode              = FSMC_WrapMode_Disable;                 // Don't know yet

  FSMC_NORSRAMInitStructure.FSMC_DataAddressMux        = FSMC_DataAddressMux_Disable;           // Don't know yet

  FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode       = FSMC_BurstAccessMode_Disable;          // Don't know yet

 

  FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);

 

  // Enable FSMC Bank1_SRAM Bank

  FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE); 

Thanks

#ssd1963-lcd #lmgtfy #st32f2-fsmc #ssd1963-stm32f4-lcd-fsmc
12 REPLIES 12
frankmeyer9
Associate II
Posted on June 12, 2012 at 08:50

I guess your expectations are a little high.

This is 1/3 of a MByte of display RAM, considerably more than the available RAM of the controller. So you need to do all graphic operations in place, no double buffering.

Generally, such a display belongs more to the 'Application' class - a task for the Cortex A devices, which have more RAM, performance and the appropriate hardware interfaces.

I have a smaller display (32x240) with the same controller, driving it with GPIO.

Its certainly good enough to bring information to the display - everthing called 'entertainment' becomes tricky with a Cortex M. You might need to add external RAM, and use DMA to do graphic operations.

alok472
Associate II
Posted on June 13, 2012 at 02:40

We have used 320x240 pixel data in 565 format.

Works ok on FSMC with DMA with refresh rate >30 Hz

External RAM connected ofcourse.

joembiye
Associate II
Posted on June 13, 2012 at 08:37

Hi all,

I'm also working on a project with a dumb TFT LCD (320 x 240). I'm trying to display static images (no double buffer). I've been able to display images (in 565 format) that I load on the flash memory using DMA and FSMC. I'm now trying to refresh the same images from external RAM using DMA again but I don't seem to get it right. What I'm doing is copying the images from the flash to the external memory using DMA and then refresh from the external memory.

I thought maybe I wasn't writing to external RAM, I tried to view what's inside the external memory after writing and I was able to see the same data that is on flash.

I based my approach on the AN3241.

Can you guys please help me to see what I'm doing wrong.

Thank you

linas2
Associate II
Posted on June 13, 2012 at 09:09

i can get around 25FPS with each pixel location (like paint dot with collor, paint another dot with another colour at new coordinate)

if i try to allocate ram and fill it with colour, i get 300FPS (so that would be for pictures, in theory i am geting 60FPS since that is panel limitation) i am using over-clocked STM32F4 at more than 200MHz core speed and ~60MHz gpio speed

FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef FSMC_NORSRAMTimingInitStructure;
FSMC_NORSRAMTimingInitStructure.FSMC_AddressSetupTime = 0; 
FSMC_NORSRAMTimingInitStructure.FSMC_AddressHoldTime = 0; 
FSMC_NORSRAMTimingInitStructure.FSMC_DataSetupTime = 0; 
FSMC_NORSRAMTimingInitStructure.FSMC_BusTurnAroundDuration = 0;
FSMC_NORSRAMTimingInitStructure.FSMC_CLKDivision = 1;
FSMC_NORSRAMTimingInitStructure.FSMC_DataLatency = 0;
FSMC_NORSRAMTimingInitStructure.FSMC_AccessMode = FSMC_AccessMode_A;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;
FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &FSMC_NORSRAMTimingInitStructure;
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
FSMC_NORSRAMTimingInitStructure.FSMC_AddressSetupTime = 0; 
FSMC_NORSRAMTimingInitStructure.FSMC_AddressHoldTime = 0; 
FSMC_NORSRAMTimingInitStructure.FSMC_DataSetupTime = 3; 
FSMC_NORSRAMTimingInitStructure.FSMC_BusTurnAroundDuration = 0;
FSMC_NORSRAMTimingInitStructure.FSMC_CLKDivision = 1;
FSMC_NORSRAMTimingInitStructure.FSMC_DataLatency = 0;
FSMC_NORSRAMTimingInitStructure.FSMC_AccessMode = FSMC_AccessMode_A; 
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &FSMC_NORSRAMTimingInitStructure;
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);

and that is mine SSD1963 config with 8MHz PCLK (aka 60FPS for 480x272)

LCD_PinConfig(); 
LCD_FSMCConfig();
LCD_WriteCom(0x0001);Delay(500);
LCD_WriteCom(0x0011);Delay(500);
LCD_WriteCom(0x0029);Delay(500);
LCD_WriteCom(0x00E2);Delay(500);
LCD_WriteRAM(0x0021);Delay(500); 
LCD_WriteRAM(0x0002);Delay(500); 
LCD_WriteRAM(0x0004);Delay(500); 
LCD_WriteCom(0x00E0);Delay(500); 
LCD_WriteRAM(0x0001);Delay(500);
LCD_WriteCom(0x00E0);Delay(500);
LCD_WriteRAM(0x0003);Delay(500);
LCD_WriteCom(0x0001);Delay(500); 
LCD_WriteCom(0x00E6);Delay(500); 
LCD_WriteRAM(0x0002);Delay(500);
LCD_WriteRAM(0x0048);Delay(500);
LCD_WriteRAM(0x009E);Delay(500);
LCD_WriteCom(0x00B0);Delay(500); 
LCD_WriteRAM(0x0028);Delay(500);
LCD_WriteRAM(0x0000);Delay(500);
//LCD Specification
LCD_WriteRAM((HDP>>8)&0X00FF);Delay(500); 
LCD_WriteRAM(HDP&0X00FF);Delay(500);
LCD_WriteRAM((VDP>>8)&0X00FF);Delay(500); 
LCD_WriteRAM(VDP&0X00FF);Delay(500);
LCD_WriteRAM(0x0000);Delay(500);
LCD_WriteCom(0x00B4); 
LCD_WriteRAM((HT>>8)&0X00FF); 
LCD_WriteRAM(HT&0X00FF);
LCD_WriteRAM((HPS>>8)&0X00FF); 
LCD_WriteRAM(HPS&0X00FF);
LCD_WriteRAM(HPW); 
LCD_WriteRAM((LPS>>8)&0X00FF); 
LCD_WriteRAM(LPS&0X00FF);
LCD_WriteRAM(0x0000);
LCD_WriteCom(0x00B6); 
LCD_WriteRAM((VT>>8)&0X00FF); 
LCD_WriteRAM(VT&0X00FF);
LCD_WriteRAM((VPS>>8)&0X00FF); 
LCD_WriteRAM(VPS&0X00FF);
LCD_WriteRAM(VPW); 
LCD_WriteRAM((FPS>>8)&0X00FF); 
LCD_WriteRAM(FPS&0X00FF);
LCD_WriteCom(0x00026); 
LCD_WriteRAM(0x00002); 
LCD_WriteCom(0x0035);
LCD_WriteRAM(0x0000);
// LCD_WriteCom(0x00BA);
// LCD_WriteRAM(0x000F); //GPIO[3:0] out 1
// LCD_WriteCom(0x00B8);
// LCD_WriteRAM(0x0007); //GPIO3=input, GPIO[2:0]=output
// LCD_WriteRAM(0x0001); //GPIO0 normal
// LCD_WriteCom(0x0036); //rotation
// LCD_WriteRAM(0x0000);
// LCD_WriteRAM(0x0060);
// LCD_WriteCom(0x0035); //rotation
// LCD_WriteRAM(0x0050);
// LCD_WriteCom(0x0026); //rotation
// LCD_WriteRAM(0x0003);
// LCD_WriteCom(0x0030); //rotation
// LCD_WriteRAM(0x0000);
LCD_WriteCom(0x00F0); 
LCD_WriteRAM(0x0003);
LCD_Clear(BLACK);
LCD_WriteCom(0x0029);

Also note that if you have configuration file from china (OPENMCU of something like that) they configurated driver for 10x slower operation for no good reasons, in my case that was around 5FPS refresh rate, now i have 8MHz pclk and 60FPS refresh rate. try to overclock your F2 with PLL settings, and set that to maximum stable frequency ( but be careful, it will mess your timing critical applications)
cpt
Associate
Posted on August 02, 2012 at 16:59

Can I have your mail address because of direct contatct? I've got a small issule with DMA and SSD1963 together.

Posted on March 26, 2013 at 18:33

Hello, I am just trying something similar to what you've done. 7'' inch display (800 x 480) with SSD1963 and a STM32F4 Discovery board.  Would you mind giving me the schematics of the interconnections between the LCD board and the STM board ? That would help me a lot, thanks.

Alberto

frankmeyer9
Associate II
Posted on March 27, 2013 at 10:36

7'' inch display (800 x 480) with SSD1963 and a STM32F4 Discovery board.

 

I hope you realize that is about 4 times the size of the internal RAM of the stm32f4, assuming 16 bit colors. Although it is feasible, you are limited in the capability to buffer graphics data, never mind drawing speed.

Posted on March 27, 2013 at 12:13

Yes, I know that. But the original poster succeeded in having an STM32F4 board driving the 7'' 800x480display, albeit at only 3 frames per second. For my application that is more than fast enough.

What I need is just the schematic of the electrical connections between the two boards.

Posted on March 27, 2013 at 15:19

The SSD1963 has 1.2MB on board for a frame buffer, so the internal memory of the STM32F4 is of little import except for staging data from some external source like an SD Card.

It looks to use a pretty straight forward peripheral interfacing scheme.

A number of people seem to have interfaced these to STM32, suggest you check via Google or eBay sellers of such.

http://www.ebay.com/itm/7-Touch-Panel-SSD1963-TFT-LCD-Module-STM32-Dev-Board-/200641684729

http://www.egochina.net.cn/eBay/Download/AT070TN92_TP_SSD1963.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..