1. 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.
    Dismiss Notice

Writing a framebuffered driver for ILI9230 LCD Controller

Discussion in 'ARM' started by ahmedragia21, Apr 5, 2014.

  1. ahmedragia21

    ahmedragia21 Member

    Joined:
    Apr 5, 2006
    Messages:
    470
    Likes:
    1
    Location:
    Egypt,Cairo
    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 (text):

    #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);}
    }
     

Share This Page