• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Writing a framebuffered driver for ILI9230 LCD Controller

Status
Not open for further replies.
I'm using STMF32F103VE to control an ILI9320 LCD Controller, the datasheet is here:http://www.gpegint.com/files/library/files/supportpdf/ILI9320.pdf

I have problems of copying the framebuffer memory to the LCD itself. I tried to plot some pixels but they have weird and incorrect placement on the screen, I tried a lot of debugging but it seems there is something that I can't see. I attached the following three calls that I'm using the super loop, and I'm also using the FSMC with the LCD.
Code:
#define fbWidth 160#define fbHeight 200
u16 frameBuffer[fbWidth*fbHeight];// 160*200*16bit

here are the functions that I used to write to the FB then copy to the LCD.

void LCD_ClearFB(){
LCD_SetCursor(0,0);
u16 pixel;for( pixel =0; pixel< fbHeight*fbWidth; pixel++){
frameBuffer[pixel]=0x0;

}

}
void LCD_Flip()// copy the Framebuffer to the LCD Gram{
LCD_WriteRegister(0x0050,0);// Horizontal GRAM Start Address
LCD_WriteRegister(0x0051, fbWidth);// Horizontal GRAM End Address
LCD_WriteRegister(0x0052,0);// Vertical GRAM Start Address
LCD_WriteRegister(0x0053, fbHeight);// Vertical GRAM Start Address
LCD_WriteRegister(32,0);
LCD_WriteRegister(33,0);
LCD_WriteIndex(34);


u16 pixel;for( pixel =0; pixel< fbHeight*fbWidth; pixel++){
u16 color = frameBuffer[pixel];
LCD_WriteData(color);}
}
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top