digitalmars.D - Help ME Drive SSD1963
- zoezz (199/199) Aug 29 2017 I am involving in an electronic project--make a set of control
I am involving in an electronic project--make a set of control board. The MCU is 103ZET6 while the driving chip is SSD1963 and the screen is AT070TN92. However,I don’t know why the screen can’t be lighted? IF you need more detail or datasheet about SSD1963,please click: http://www.kynix.com/Detail/189630/SSD1963G41.html And this is the code: [code]//RS pin connect FSMC_A10 while the data address is (2^10)*2 | 0x60000000 = 0x6000 0800 #define Bank1_LCD_Data ((uint32_t)0x60000800) //disp Data ADDR #define Bank1_LCD_Reg ((uint32_t)0x60000000) //disp Reg ADDR //============================//screen is AT070TN92 and resolution is 800*480 unsigned int HDP=799; unsigned int HT=799; unsigned int HPS=60; unsigned int LPS=8; unsigned char HPW=1; unsigned int VDP=479; unsigned int VT=499; unsigned int VPS=12; unsigned int FPS=4; unsigned char VPW=10; //============================// void Delay(u16 nCount) { while(nCount--); } //===================================// //function declaration :Write command function //index :written command //===================================// void LCD_WR_REG(unsigned int index) { *(__IO uint16_t *) (Bank1_LCD_Reg)= index; } //===================================// //function declaration :Write function register data //index :Written address of the data //val :written data //===================================// void LCD_WR_CMD(unsigned int index,unsigned int val) { *(__IO uint16_t *) (Bank1_LCD_Reg)= index; *(__IO uint16_t *) (Bank1_LCD_Data)= val; } //===================================// //function declaration :read data //returned value :read data //===================================// u16 LCD_RD_Data(void) { u16 a=0; a=*(__IO uint16_t *) (Bank1_LCD_Data); return(a); } //===================================// //function declaration :write data //val :written data //===================================// void LCD_WR_Data(unsigned int val) { *(__IO uint16_t *) (Bank1_LCD_Data)= val; } // //===================================// //function declaration :FSMC configuration function of SSD1963 //===================================// void SSD1963_FSMC_Init(void) { FSMC_NORSRAMTimingInitTypeDef readWriteTiming; FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure; FSMC_GPIO_Init(); //======================================================//reading and writing timing configuration slow initialization time readWriteTiming.FSMC_AddressSetupTime = 0x02;//0x00 //Address setup time(ADDSET) readWriteTiming.FSMC_AddressHoldTime = 0x02; //0x00 //Address keeping time(ADDHLD) readWriteTiming.FSMC_DataSetupTime = 0x05; //0x01 //data keeping time(DATAST) readWriteTiming.FSMC_BusTurnAroundDuration = 0x02;//0x00 readWriteTiming.FSMC_CLKDivision = 0x00; readWriteTiming.FSMC_DataLatency = 0x00; readWriteTiming.FSMC_AccessMode = FSMC_AccessMode_A; //mode A //======================================================// FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1; //use NE1 FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; FSMC_NORSRAMInitStructure.FSMC_MemoryType =FSMC_MemoryType_SRAM; FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b; //The memory data width is 16bit FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode =FSMC_BurstAccessMode_Disable; FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low; FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait=FSMC_AsynchronousWait_Disable; FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable; FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState; FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable; //Memory write enabled FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable; FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable; //Reading and writing using the same sequence FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable; FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &readWriteTiming; FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &readWriteTiming; //读写同样时序 FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure); //initialize FSMC configuration FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE); //enable BANK1 } // //===================================// //function declaration : Initialization function of SSD1963 //===================================// void SSD1963_Init(void) { SSD1963_FSMC_Init(); LCD_WR_REG(0x0001); //RESET delay_ms(10); LCD_WR_REG(0x00E2); //PLL multiplier, set PLL clock to 120M LCD_WR_Data(0x002C); //N=0x36 for 6.5M, 0x23 for 10M crystal LCD_WR_Data(0x0002); LCD_WR_Data(0x0004); LCD_WR_REG(0x00E0); //PLL enable LCD_WR_Data(0x0001); Delay(50); LCD_WR_REG(0x00E0); LCD_WR_Data(0x0003); Delay(50); LCD_WR_REG(0x0001); // software reset Delay(100); LCD_WR_REG(0x00E6); //PLL setting for PCLK, depends on resolution LCD_WR_Data(0x0003); LCD_WR_Data(0x0033); LCD_WR_Data(0x0033); LCD_WR_REG(0x00B0); //LCD SPECIFICATION LCD_WR_Data(0x0000); LCD_WR_Data(0x0000); LCD_WR_Data((HDP>>8)&0X00FF); //Set HDP LCD_WR_Data(HDP&0X00FF); LCD_WR_Data((VDP>>8)&0X00FF); //Set VDP LCD_WR_Data(VDP&0X00FF); LCD_WR_Data(0x0000); LCD_WR_REG(0x00B4); //HSYNC LCD_WR_Data((HT>>8)&0X00FF); //Set HT LCD_WR_Data(HT&0X00FF); LCD_WR_Data((HPS>>8)&0X00FF); //Set HPS LCD_WR_Data(HPS&0X00FF); LCD_WR_Data(HPW); //Set HPW LCD_WR_Data((LPS>>8)&0X00FF); //Set HPS LCD_WR_Data(LPS&0X00FF); LCD_WR_Data(0x0000); LCD_WR_REG(0x00B6); //VSYNC LCD_WR_Data((VT>>8)&0X00FF); //Set VT LCD_WR_Data(VT&0X00FF); LCD_WR_Data((VPS>>8)&0X00FF); //Set VPS LCD_WR_Data(VPS&0X00FF); LCD_WR_Data(VPW); //Set VPW LCD_WR_Data((FPS>>8)&0X00FF); //Set FPS LCD_WR_Data(FPS&0X00FF); LCD_WR_REG(0x00BE); //set PWM for B/L LCD_WR_Data(0x0001); LCD_WR_Data(0x00ff); LCD_WR_Data(0x0001); LCD_WR_Data(0x00f0); LCD_WR_Data(0x0000); LCD_WR_Data(0x0000); LCD_WR_REG(0x00F0); //pixel data interface LCD_WR_Data(0x0003); LCD_WR_REG(0x0036); //rotation LCD_WR_Data(0x0000); LCD_WR_REG(0x0026); //display on LCD_WR_Data(0x0001); LCD_WR_REG(0x0029); //display on LCD_WR_REG(0x00d0);//Set up dynamic backlight control configuration LCD_WR_Data(0x000d); } //[/code]
Aug 29 2017