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:
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!


Hi Thomas,
I have the same LCD, and I have it all working but I am have a bit of a problem when displaying a picture.
Can you please help me on this?
What routine are you using to display the picture?
Thanks
Frank
Hi Frank.
Have you made your own library? If not, which library are you using?
I’m using a mixed library – I’ve mixed something from the uC/OS LCD library and something from ST’s LCD library.
This included the Pixel, Circle, Text, Square commands – and then I made my own picture display command!
First I save the image file on my computer as a 24-bit BMP.
Next I use a program I made in VB.NET to convert the BMP to a header file.
Last I include the header file in the project, and run the picture display command when needed.
Best regards
Thomas Jespersen
I am using the same library.
I have using the following 2 programs to convert the image to .h
http://www.thaieasyelec.net/archives/Manual/bmp2h_conv%20v5.1.rar
http://www.thaieasyelec.net/archives/Manual/IMG2HEX.rar
This is my DrawPicture routine:
void LCD_DrawPicture(u16 StartX,u16 StartY,u16 EndX,u16 EndY,const unsigned short *pic) {
u32 i;
LCD_SetWindows(StartX,StartY,EndX,EndY);
LCD_SetCursor(StartX,StartY);
Clr_Cs;
LCD_WriteIndex(0×0022);
Set_Rs;
for (i=0;i<(EndX*EndY) ;i++)
{
LCD_WriteData(*pic++);
Clr_nWr;Set_nWr;
}
Set_Cs;
}
Can you please check and verify if the above are working?
Best regards,
Frank
It looks correct, but you can exclude the Set_Rs; just after the WriteIndex, as the WriteIndex sets the Rs pin high too!
I’ve tried this code too, but the SetWindows command was the thing which was the problem for me!
I’ve sent you an email with my DispPic code and my converter program – please try that and tell me if it works
Hi Thomas ,,,
See my development across SSD2119 & SPFD5420A in Crystalfontz forum ..
SSD2119Z
SPFD5420A
http://www.crystalfontz.com/forum/showthread.php?t=6401
http://www.crystalfontz.com/forum/showthread.php?t=6540
Last night I also hacked Nokia E51 LCD 240×320 ,, I’ll shortly post my project ..
Best Regards
Imran
Very nice projects you’ve made – I hope sometime to be able to develop nice GUI’s like you, I just don’t have any ideas…
Hi thomas ,,,
I’ve just hacked another Branded Cell Phone TFT ,, NOKIA E51
:):)
Visit my post on sparkfun … & if you wish then leave the comments their on sparkfun ..
http://forum.sparkfun.com/viewtopic.php?f=14&t=20935
thanks & Best Regards
Imran
Hi Thomas,
nice job! Do you use the SPI interface of the display?
Regards
Stefan
No, I haven’t tried using the SPI interface to control the LCD!
The problem with the SPI is also the speed. SPI is pretty slow when you have to transfer 16-bit color data to the whole screen = 2 bytes (16-bit) * 320 * 240 = 153600 bytes!
So I’m using the 16-bit parallel interface instead, which means that I can send color data by clocking only once – of course I have to send some register adress settings first, which also requires some clock cycles, but it is much faster!
I’m going to buy a TFT display but i don’t know the difference between ILI9320 SSD2119 this will be my first adventure about display.. so what ’s the better!? i like your display based on SSD2119 but i don’t know nothing about it.. i found it on ebay and is cheaper than the 3,2 ” which you have just used .. i don’t find a library ready to use.. and I will not by something that maybe i’ll not able to use..tell me something XD i need some help..sorry i’m italian and my english is bad
Hi Matteo.
The display I’m using is a 3.5″ display, and it was also found on eBay.
I don’t know which controller to recommend, as they are much the same, also the controlling commands.
As you can see on my blog I’ve tried using both, so I’ve made a library for both. So if you need a library, I have already made some – but if you want to, you could also make the yourself, just by looking at the datasheet!
So I would recommend just buying the display you like (probably the cheapest) – as it doesn’t matter if it has an ILI9320, ILI9325 or SSD2119!
Best Regards
Thomas Jespersen
I’ll need some help maybe.. XD but i want to try,yesterday i did a library of a rude controller..the KS108 but it was boring..too simple and I want to put myself to the test !!!!
but i don’t know if a simple PIC like PIC18F4620-I/P can store enough code lines in order to do some good projects.. it has got a PLL but the max clock will be 40 Mhz is it enough?!i need something else in order to control MMC touchpad !?so what are the peripherals i need?please give me some advice..
I like the 3.5″ cuz is bigger than another one i will buy it
Best Regards
Matteo Dal Molin
Dear Matteo.
The ILI9320 display I have I connected to an Arduino (8-bit – 16MHz), but also to an PIC18F452.
This video is an example of what another guy have made with the same display as me (ILI9320) and a PIC18F458: http://www.youtube.com/watch?v=rRAn5ovDEmE
The great thing is that both the ILI9320 is supported by Microchips Graphics Library, but be aware that not everything in that library will run on the PIC18’s.
About Touch Screen, I don’t really know, as I haven’t tried it with the PIC or Arduino. I don’t think it would be any problem though, as it doesn’t takes much effort to read a touch screen variable (maybe even a digital touch screen controller).
Best Regards
Thomas Jespersen
ok thank you! i hope that 40 Mhz will be enough to get a good refresh of the display so this week i’m going to buy 3.2 320×240 SSD2119…:):)
Ok!
Keep me updated
OK! i’ve just see your project with dot matrix..i’ve been doing something like that but it is incomplete up to now ..it’s tetris game with 13×8 dot matrix..I can’t continue it cuz i promised to my friend that we will finish it together XD we have to do the last function which corporate the array of block and the game field and the counting of lines
enjoy your projects .. we will talk soon !
Hi Tomas,
I’m runnig the demonstration software for the STM3210E-Eval.
I displayed the main menu & the icons and now I need now to display some other icons according to my application to load them after that to the Internal Flash via DfuSe.
Can you please help me with this ??
Best Regards,
I bought the same LCD board on ebay, but I have some problem, I think that it is in init sequence…
How do you set the setting register? (I don’t understand how set some value)
Thank’s
Luca
Waaaa!The LCD 3.2 320×240 SSD2119 has just arrived..but i have no time to try .. could you give me a library for pic?!So I can try it in my spare time..because i’m working and i’m hardly ever at home
Best regards!
@Matteo
I haven’t got any SSD2119 library for the PIC, as I’m using a mixed library.
I’ve mixed something from the uC/OS LCD library and something from ST’s LCD library.
You could try to download both things/libraries and then convert it for the PIC – it shouldn’t be that difficult, as the language is C, which is common for both C18 and Ride7 (GNU GCC)
Best Regards
Thomas Jespersen
@Thomas Jespersen
ok! this weekend I’ll try I saw your module based on a arm cortex M3 I’m interested about that so I found it on ebay..and maybe It’s one of the cheapest arm based system..Do you know other better solution!?I always work with pics but I understood for high speed ARM it’s better so i think that this module it’s suitable for beginners!so what do you think!?
http://www.youtube.com/watch?v=dRggob7InTM This is the last school project made by me and others two friend..It’s quite rude but we had no time to improve the project and we had no money to buy quality components !
I need also a programmer/debugger what do you suggest to me!? I saw on ebay one like the yours and also this one
http://cgi.ebay.it/Keil-ULINK2-ARM-USB-JTAG-ARM9-ARM7-Cortex-M3-Cortex-M0-/290453659671?cmd=ViewItem&pt=LH_DefaultDomain_0&hash=item43a0632017
I know that the second it’s a clone.. What is the best solution?!Sorry but I know nothing about ARM
I have the same display but I’m having trouble getting any images displayed. Could you mail me a copy of the initialisation code you use?
Thanks
@Matteo
Nice robot project – I’ve never done anything like that yet
Anyways I really love that breakout board with the STM32F103RET6, as it’s cheap and I can interface what I want to interface to it – I’m not struggling with a development board with only a couple of I/O lines broke out (though development boards can be easier to start with)
About the programmer, I’ve got this one http://cgi.ebay.ca/Raisonance-RLink-R-Link-Programmer-ARM-ARM7-ARM9-STM32-/150456002965?cmd=ViewItem&pt=LH_DefaultDomain_2&hash=item2307e06995#ht_1972wt_911 for $15 as there was an auction that time. But that Keil ULINK2 is also very great, as it supports other ARM processors too – which the RLink doesn’t!
But you don’t need any processor, you only need an RS232 port (USB->RS232 converter works too) to program the chip. But if you want to do debugging, then you have to buy a programmer/debugger like theese two.
Best Regards
Thomas Jespersen
@BitWise
Done
@Mariem
Sorry for the late response, your comment was lost in my Spam filter
Unfortunately I haven’t tried the STM3210E-EVAL board, but I’ve took a look at the code, and it looks pretty straight forward.
But I don’t know exactly what you are trying to do and needs help with – could you please explain?
Thomas