bianchi77
Advanced Member level 4
- Joined
- Jun 11, 2009
- Messages
- 1,313
- Helped
- 21
- Reputation
- 44
- Reaction score
- 20
- Trophy points
- 1,318
- Location
- California
- Activity points
- 9,442
Friends,
I've tried to initiate TFT LCD with chipset SD1289,
Photo of the result :
Init code :
Does anyone have experience in initializing this SD1289 LCD ? I'm using AT89LV55 MCU
Thanks
I've tried to initiate TFT LCD with chipset SD1289,
Photo of the result :
Init code :
Code:
void Lcd_Write_Com( int DH) //ÃüÁî
{
LCD_RS=0;
LCD_CS =0;
LCD_DataPortH=DH>>8;
LCD_DataPortL=DH;
LCD_WR=0;
LCD_WR=1;
LCD_CS =1;
}
void Lcd_Write_Data(int DH) //Êý¾Ý
{
LCD_RS=1;
LCD_CS =0;
LCD_DataPortH=DH>>8;
LCD_DataPortL=DH;
LCD_WR=0;
LCD_WR=1;
LCD_CS =1;
}
void main_init(void)
{
LCD_RS = 1;
LCD_WR = 1;
LCD_RD = 1;
LCD_CS = 1;
LCD_REST = 0;
//P1 = 0xFF;
delayms(100);
LCD_REST = 1;
P2 = 0x00;
delayms(20);
P3 = 0x00;
delayms(20);
// Start screen initialisation
Lcd_Write_Com(OSC_START); //Start Oscillation
Lcd_Write_Data(0x00);
Lcd_Write_Data(0x01);
delayms(30);
Lcd_Write_Com(DRIVER_OUT); //Driver Output Control
Lcd_Write_Data(0x23);
Lcd_Write_Data(0x3F);
delayms(30);
Lcd_Write_Com(LCD_DRIVE_AC); //LCD Drive AC Control
Lcd_Write_Data(0x06);
Lcd_Write_Data(0x00);
delayms(30);
Lcd_Write_Com(POWER_CONTROL1); //Power Control (1)
Lcd_Write_Data(0xA8);
Lcd_Write_Data(0xA6);
delayms(30);
Lcd_Write_Com(DISPLAY_CONTROL); //Display Control
Lcd_Write_Data(0x00);
Lcd_Write_Data(0x33);
delayms(30);
Lcd_Write_Com(POWER_CONTROL2); //Power Control (2)
Lcd_Write_Data(0x00);
Lcd_Write_Data(0x05);
delayms(30);
Lcd_Write_Com(POWER_CONTROL3); //Power Control (3)
Lcd_Write_Data(0x30);
Lcd_Write_Data(0x0B);
delayms(30);
Lcd_Write_Com(POWER_CONTROL4); //Power Control (4)
Lcd_Write_Data(0x20);
Lcd_Write_Data(0x00);
delayms(30);
Lcd_Write_Com(ENTRY_MODE); //Set Display color mode for 65k color
Lcd_Write_Data(0x68);
Lcd_Write_Data(0x30);
delayms(30);
Lcd_Write_Com(SLEEP_MODE); //Exit Sleep Mode
Lcd_Write_Data(0x00);
Lcd_Write_Data(0x00);
delayms(30); //delay 30ms
Lcd_Write_Com(POWER_CONTROL5); //Power Control (5)
Lcd_Write_Data(0x00);
Lcd_Write_Data(0xA8);
delayms(30);
Lcd_Write_Com(HORIZONTAL_RAM_START); //Horizontal RAM address position start/end setup
Lcd_Write_Data(0xEF); //decimal 239
Lcd_Write_Data(0x00); //decimal 0, i.e. horizontal ranges from 0 -> 239
delayms(30); //POR value is 0xEF00 anyway. This address must be set before RAM write
Lcd_Write_Com(VERTICAL_RAM_START); //Vertical RAM address start position setting
Lcd_Write_Data(0x00); //0x0000 = decimal 0
Lcd_Write_Data(0x00);
delayms(30);
Lcd_Write_Com(VERTICAL_RAM_END); //Vertical RAM address end position setting
Lcd_Write_Data(0x01); //0x013F = decimal 319
Lcd_Write_Data(0x3F);
delayms(30);
Lcd_Write_Com(RAM_WRITE); //Commande d'ecriture dans la Memoire ecran
LCD_CLS(BLANC); //send blank (mode 16 Bits)
}
Does anyone have experience in initializing this SD1289 LCD ? I'm using AT89LV55 MCU
Thanks
Attachments
Last edited: