ILI9481
This is my code
#include "c8051F020.h" /* CS is to ground */ sbit WR = P0^5; // Write signal pin sbit RD = P0^4; // Read signal pin sbit RS = P0^6; // Register Select signal pin #define RESET P7 // Reset signal pin #define BUS_16 // 16 bit mode #define LCD_DATA_PORTH P5 // high eight data ports, using only high eight 8-bit mode DB9 - DB15 #define LCD_DATA_PORTL P4 // low eight data ports DB0 - DB8 sbit LED1 = P3^1; sbit LED2 = P3^2; sbit LED3 = P3^3; void delay_20ms(void) { TMOD &=0xF0; TMOD |=0x01; ET0=1; TH0=0xBE; TL0=0xE6; TR0=1; while(TF0==0); ET0=0; TF0=0; } void delay_50ms(void) { TMOD &=0xF0; TMOD |=0x01; ET0=1; TH0=0x5D; TL0=0x3E; TR0=1; while(TF0==0); ET0=0; TF0=0; } void Port_IO_Init() { P3MDOUT = 0x0E; XBR2 = 0x40; } void lcd_write_bus (char VH, char VL) // write data in parallel function { LCD_DATA_PORTH=VH; LCD_DATA_PORTL=VL; WR=0; WR=1; } void LCD_ILI9481_CMD (char VH, char VL) // send command { RS=0; lcd_write_bus(VH, VL); } void LCD_ILI9481_INDEX(char VH,char VL) // send data { RS=1; lcd_write_bus(VH,VL); } void ILI9481_CPT_Initial_Code(void) { RESET = 1; delay_50ms(); RESET = 0; delay_50ms(); RESET = 1; WR = 1; RD = 1; delay_50ms(); delay_50ms(); LCD_ILI9481_CMD(0x00, 0x11); // Exit sleep mode delay_20ms(); LCD_ILI9481_CMD(0x00, 0xD0); //Power setting LCD_ILI9481_INDEX(0x00,0x07); // 1xVci LCD_ILI9481_INDEX(0x00,0x42); LCD_ILI9481_INDEX(0x00,0x18); LCD_ILI9481_CMD(0x00,0xD1); // Vcom control LCD_ILI9481_INDEX(0x00,0x00); LCD_ILI9481_INDEX(0x00,0x07);//07 LCD_ILI9481_INDEX(0x00,0x10); LCD_ILI9481_CMD(0x00,0xD2); // Power setting for normal mode LCD_ILI9481_INDEX(0x00,0x01); LCD_ILI9481_INDEX(0x00,0x02); LCD_ILI9481_CMD(0x00,0xC0); // Panel driving settings LCD_ILI9481_INDEX(0x00,0x10); LCD_ILI9481_INDEX(0x00,0x3B); LCD_ILI9481_INDEX(0x00,0x00); LCD_ILI9481_INDEX(0x00,0x02); LCD_ILI9481_INDEX(0x00,0x11); LCD_ILI9481_CMD(0x00,0xC5); // Frame rate and inversion control LCD_ILI9481_INDEX(0x00,0x03); // 72 Hz LCD_ILI9481_CMD(0x00,0xC8); // Gamma settings LCD_ILI9481_INDEX(0x00,0x00); LCD_ILI9481_INDEX(0x00,0x32); LCD_ILI9481_INDEX(0x00,0x36); LCD_ILI9481_INDEX(0x00,0x45); LCD_ILI9481_INDEX(0x00,0x06); LCD_ILI9481_INDEX(0x00,0x16); LCD_ILI9481_INDEX(0x00,0x37); LCD_ILI9481_INDEX(0x00,0x75); LCD_ILI9481_INDEX(0x00,0x77); LCD_ILI9481_INDEX(0x00,0x54); LCD_ILI9481_INDEX(0x00,0x0C); LCD_ILI9481_INDEX(0x00,0x00); LCD_ILI9481_CMD(0x00,0x36); // set address mode LCD_ILI9481_INDEX(0x00,0x0A); LCD_ILI9481_CMD(0x00,0x3A); // set pixel format LCD_ILI9481_INDEX(0x00,0x55); LCD_ILI9481_CMD(0x00,0x2A); // set column address LCD_ILI9481_INDEX(0x00,0x00); LCD_ILI9481_INDEX(0x00,0x00); LCD_ILI9481_INDEX(0x00,0x01); LCD_ILI9481_INDEX(0x00,0x3F); LCD_ILI9481_CMD(0x00,0x2B); // set page address LCD_ILI9481_INDEX(0x00,0x00); LCD_ILI9481_INDEX(0x00,0x00); LCD_ILI9481_INDEX(0x00,0x01); LCD_ILI9481_INDEX(0x00,0xE0); delay_50ms(); delay_50ms(); delay_50ms(); LCD_ILI9481_CMD(0x00,0x29); LCD_ILI9481_CMD(0x00,0x2C); } void ILI9481_Clear(char VH,char VL) { int i,j; for(i=0;i<480;i++) { for (j=0;j<320;j++) { LCD_ILI9481_CMD(VH,VL); } } } void main() { Port_IO_Init(); LED1 = 0; ILI9481_CPT_Initial_Code(); ILI9481_Clear(0xff, 0xff); while (1) { ILI9481_Clear(0xf8,0x00); // red //delayms(2000); ILI9481_Clear(0x07,0xE0); // green //delayms(2000); ILI9481_Clear(0x00,0x1f); // blue LED1=1; } }
3.2-inch TFT Color LCD Module is a TFT LCD Screen Module , 40pins interface ,16 bit, not just a LCD break but include the Touch , SD card and Flash design. So it's a powerful extension module for your project.
This item is 240374PQ . It's a 65K color , 320*240 (resolution),3.2 inch TFT LCD screen.The LCD has a wide viewing angle , the contrast is also very suitable.
The Screen include a controller SSD1289, it's a support 8/16bit data interface , easy to drive by many MCU like STM32 ,AVR and 8051.
It is designed with a touch controller in it . The touch IC is ADS7843 , and touch interface is included in the 40 pins breakout. It is the version of product only with touch screen and touch controller.
Pin definition:
The pins named with "D_" is the touch bus , the pins named with "SD_" is SD bus, the pins named with "F_" is Flash bus.
It is work at 3.3v DC, if you need to connect the module with the 5v voltage I/O , you need to add the 30k and 20k resistors to reduce voltage. It support that it can default use the 16 bit modehttp://www.amazon.co.uk/HY-TFT320-inch-Screen-module-interface/dp/B00CW8PNVE
I also checked on one more wiki site.. it says the same, LCD Driver SSD1289
Datasheet:
Reference: http://www.electrodragon.com/w/Category:3.2_TFT_LCD
Just look at the link mentioned above and I am sure using the right LCD controller driver should solve your problem.