Home > ARM > 320×240 Color Display – SSD2119

320×240 Color Display – SSD2119

I finally got the display I bought on eBay to work. It took me a lot of hours as the man I’d bought the display from told me that the display controller was an ILI9320, so I started making code for the display like it was using an ILI9320 controller.

But as it didn’t work, I started debugging using my Raisonance RLink, and just when I looked at the Device variable – a variable which holds the controller number, and is loaded at the initialization process of the display, it showed me that it was an SSD2119 controller.

So I found the SSD2119 datasheet and started recoding using the new Command calls found in the datasheet… Finally it worked and showed some life 🙂

So right now I have a working SSD2119 code with SetPixel, Text, Circle, Rectangle, Fill and some working Touch Screen commands for the onboard ADS7843 touch screen controller.

Please take a look at this image to see the display in action:

SSD2119 seen from top

SSD2119 from top

SSD2119 Pringles example

The current GUI commands I’ve made is:
void Lcd_Text(u16 x, u16 y, u8 *str, u16 len,u16 Color, u16 bkColor);
void Lcd_Line(u16 x0, u16 y0, u16 x1, u16 y1,u16 color);
void Lcd_Circle(u16 cx,u16 cy,u16 r,u16 color,u8 fill);
void Lcd_Rectangle(u16 x0, u16 y0, u16 x1, u16 y1,u16 color,u8 fill); // Slower than Lcd_ColorBox
void Lcd_Square(u16 x0, u16 y0, u16 width, u16 color,u8 fill);
void Lcd_ClearCharBox(u16 x,u16 y,u16 color);
void Get320240PictureCode(u8* pBuffer,u32 BufferCounter,u32 BaseAddr);

void Lcd_FastRectangle(u16 x0, u16 y0, u16 x1, u16 y1,u16 color,u8 fill); // Faster than Lcd_Rectangle
void Lcd_FastSquare(u16 x0, u16 y0, u16 width, u16 color,u8 fill); // Faster than Lcd_Rectangle
void Lcd_FastClearCharBox(u16 x,u16 y,u16 color);

void DispPic320_240(const unsigned char *str);
void DispPic(u16 x0, u16 y0, const unsigned char *str);

DispPic320_240 and DispPic uses a byte array to show a image – the byte array is converted from a 24-bit .BMP (bitmap) file using a program I’ve made in Visual Basic .NET!

You can download the STM32 code for a Paint Demo application I’ve made here: SSD2119_PaintDemo
OBS.: The project files in there is for Ride7, but the code can be used together with ARM-GCC

Categories: ARM Tags: , , ,
  1. October 18th, 2014 at 19:50 | #1

    Yes, you could theoretically control this display with 4-wire SPI but the update rate will be very slow -- especially if you want 16.7M colors which is 24-bit. Instead I would recommend you to use the 16-bit parallal bus and reduce the colors to 16-bit (65.5K), as this will give you a much smoother refresh rate.

    Regards Thomas

  2. Miquel
    August 31st, 2016 at 21:40 | #2

    Hi Thomas

    Searching the net a program about touch screen controller ADS7843 I went to your page.
    Very interesting all publications!!.

    Well! I pass to tell you my problem.

    Three months ago I have one 3,5 TFT color LCD module 320x240 with SSD2119 and ADS7843.
    With the specifications of datasheet I have written a program,mode 16 bits,in assembler
    asm51 running on micro AT89S8253 perfectly;but I have a problem with the programming ads7843.

    I don’t know well the programming SPI-control register of microprocessors.

    Please, Can you tell me what must be values bits CPOL and CPHA ?.

    Thank you very much.

  3. September 16th, 2016 at 06:16 | #3

    Sorry, such CPOL and CPHA configuration values are very specific to the processor, in this case the ATMEL ATSAM type.
    You would have to look up the data sheet or probably peripheral register-set reference sheet to find the correct values.
    Or for simple SPI communication as it is with the ADS7843 touch sensor you could also find existing examples on how to initiate SPI communication or you could write this yourself using simple bit-bang methods as fast data-speed is not needed.

  4. Miquel
    September 16th, 2016 at 21:27 | #4

    Hi Thomas:

    Very grateful for your information.
    I will do several tests and already inform you about it.

    Thank you very much.

  5. Miquel
    September 30th, 2016 at 18:35 | #5

    Hi Thomas:

    Exploring SPI protocol and with the help of a Logic Analyzer
    I managed properly program the bits CPOL and CPHA registry
    AT89S8253 control for the ADS7843 work properly.

    Regards Miquel

Comment pages
1 2 246
  1. No trackbacks yet.