AnsweredAssumed Answered

SDD1963 LCD Controller with FSMC

Question asked by amaral.guilherme.001 on Mar 11, 2013
Latest reply on Sep 15, 2014 by NEERAJ GUPTA
Hello,

Does anybody already used sdd1963 lcd controller with STM32 through FSMC?

The used code to configure the FSMC is:

void FSMC_LCD_Init(void)
{

  FSMC_NORSRAMInitTypeDef  FSMC_NORSRAMInitStructure;
  FSMC_NORSRAMTimingInitTypeDef  p;
 
  p.FSMC_AddressSetupTime = 0x01;
  p.FSMC_AddressHoldTime = 0x01;
  p.FSMC_DataSetupTime = 0x04;
  p.FSMC_BusTurnAroundDuration = 0x00;
  p.FSMC_CLKDivision = 0x00;
  p.FSMC_DataLatency = 0x00;
  p.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 = &p;
  FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p;      
  FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
   
  /* Enable FSMC Bank1_SRAM Bank */
  FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);  

}

My doubt is in the FSMC_MemoryType configuration? I found some examples code in the net and some uses FSMC_MemoryType_SRAM and others FSMC_MemoryType_NOR.

Does anybody can share the FSMC initialization code for this controller or help me, please?

My lcd initialization is

void ini(void)
{

  lcd_rst();

  LCD_WR_REG(0x0001);
  Delay(500);
  LCD_WR_REG(0x0011);
  Delay(500);
  LCD_WR_REG(0x0029);
  Delay(500);
 
  LCD_WR_REG(0x00E2);
  Delay(500);  
  LCD_WR_Data(0x0021);
  Delay(500);
  LCD_WR_Data(0x0002);
  Delay(500);
  LCD_WR_Data(0x0004);
  Delay(500);  
 
 
  LCD_WR_REG(0x00E0);
  Delay(500);  
  LCD_WR_Data(0x0001);
  Delay(500);
  LCD_WR_REG(0x00E0);
  Delay(500);  
  LCD_WR_Data(0x0003);
  Delay(500);
 
  LCD_WR_REG(0x0001);
  Delay(500);  
 
  LCD_WR_REG(0x00E6);
  Delay(500);
  LCD_WR_Data(0x0002);
  Delay(500);
  LCD_WR_Data(0x0048);
  Delay(500);  
  LCD_WR_Data(0x009E);
  Delay(500);  
 
 
  LCD_WR_REG(0x00B0);
  Delay(500);
  LCD_WR_Data(0x0028);
  Delay(500);
  LCD_WR_Data(0x0000);   
  Delay(500);  
  LCD_WR_Data(0x0001); 
  Delay(500);  
  LCD_WR_Data(0x003F);   
  Delay(500);  
  LCD_WR_Data(0x0000);   
  Delay(500);  
  LCD_WR_Data(0x00EF); 
  Delay(500);  
  LCD_WR_Data(0x0000);    
  Delay(500);
 
  LCD_WR_REG(0x00B4);
  Delay(500);  
  LCD_WR_Data(0x0001);      
  Delay(500);  
  LCD_WR_Data(0x00B8);       
  Delay(500);  
  LCD_WR_Data(0x0000);     
  Delay(500);  
  LCD_WR_Data(0x0046);    
  Delay(500);  
  LCD_WR_Data(0x000F);   
  Delay(500);  
  LCD_WR_Data(0x0000);      
  Delay(500);  
  LCD_WR_Data(0x0000);  
  Delay(500);  
  LCD_WR_Data(0x0000);    
    
  LCD_WR_REG(0x00B6);
  Delay(500);  
  LCD_WR_Data(0x0001);      
  Delay(500);  
  LCD_WR_Data(0x0048);      
  Delay(500);  
  LCD_WR_Data(0x0000);      
  Delay(500);  
  LCD_WR_Data(0x000B);    
  Delay(500);  
  LCD_WR_Data(0x0007);    
  Delay(500);  
  LCD_WR_Data(0x0000);       
  Delay(500);  
  LCD_WR_Data(0x0000);    
  Delay(500);  
    
  LCD_WR_REG(0x002A);
  Delay(500);  
  LCD_WR_Data(0x0000);     
  Delay(500);  
  LCD_WR_Data(0x0000);      
  Delay(500);  
  LCD_WR_Data(0x0001);     
  Delay(500);  
  LCD_WR_Data(0x003F);   
  Delay(500);  
 
  LCD_WR_REG(0x002B);
  Delay(500);  
  LCD_WR_Data(0x0000);      
  Delay(500);  
  LCD_WR_Data(0x0000);       
  Delay(500);  
  LCD_WR_Data(0x0000);      
  Delay(500);  
  LCD_WR_Data(0x00EF);
  Delay(500);
 
  LCD_WR_REG(0x00F0);
  Delay(500);  
  LCD_WR_Data(0x0003);
  Delay(500);  
 
 
  LCD_WR_REG(0x003A);
  Delay(500);  
  LCD_WR_Data(0x0003)     
  Delay(500);  

  LCD_WR_REG(0x0013); 
  Delay(500);  
  LCD_WR_REG(0x0029);
  Delay(500);  
 
}


Thanks in advance!
Best regards,
--
Guilherme Amaral


Outcomes