Jump to content
RobG

(Universal) Color LCD graphics library

Recommended Posts

New versions are here

 

UPDATE: Sep 3rd 2013

New way to configure dev boards

Works with TI's G2 LaunchPad (G2553,) and my G2955, F5172, F5510, F5529 dev boards.

Just one line change to switch between the boards.

Hardware and software SPI.

Supported drivers:

ILI9340/ILI9341 (2.2" 320x240)

ST7735R (JD-T1800, 1.8" LCD) needs extra work
HX8340B (BTL221722, 2.2" without touch) needs extra work
ILI9225B (2.2" with touch) needs extra work

09032013.zip

 

UPDATE: Aug 15th 2013

Added support for large displays, 320 x 240

Added rotation at run time (only ILI9340/41 at this time.)

Supported drivers:

ILI9340/ILI9341 (2.2" 320x240)

ST7735R (JD-T1800, 1.8" LCD) needs extra work
HX8340B (BTL221722, 2.2" without touch) needs extra work
ILI9225B (2.2" with touch) needs extra work

081513-16.zip

 

UPDATE: May 6th 2013

Added support for horizontal orientation

Added support for hardware SPI

Removed support for Nokia displays and 8bit color.

Supported drivers:
ST7735R (JD-T1800, 1.8" LCD)
HX8340B (BTL221722, 2.2" without touch)
ILI9225B (2.2" with touch)

050613files.zip

 

Older files

Supported drivers:

PCF8833 (Nokia 6100)
SPFD54124B (Nokia 6085 and 6101)
ST7735R (JD-T1800, 1.8" LCD)
HX8340B (BTL221722, 2.2" without touch)
ILI9225B (2.2" with touch)

pre050613files.zip

 

Share this post


Link to post
Share on other sites

Very very cool and thanks for the library! Now would it be possible to transfer some type of bitmap image/graphic to the screen? Possibly from a SD card if in the correct format?

Share this post


Link to post
Share on other sites

Sure, why not. There is a place for SD card socket on my booster pack, so once I get my hands on one...

In the mean time, I will be adding memory functions that will allow transfer of images from a computer.

When it comes to image format, TIFF is the easiest to work with, then PNG.

Share this post


Link to post
Share on other sites

Updated.

The new library can be used with Nokia and JD-T displays.

 

//#define PCF8833 // use for 6100
//#define SPFD54124B // use for 6085 and 6101
//#define ST7735R // use for JD-T1800

 

EDIT: updated files at 1:00pm EST, improved ST7735 colors.

Share this post


Link to post
Share on other sites

Thanks as always RobG! Amazing work.

 

Interesting note on this, acouple months back I bought some displays and this code worked flawlessly on them. Now recently, I got a batch of new displays and this code would fail 50% of the time. I tried increasing some of the delays which seemed to fix the issue. Just a note to anyone else that may experience the same issue.

Share this post


Link to post
Share on other sites

Which display? I have had similar issue with JD-T and I think I fixed it by adding soft reset. In any case, I will be posting updated library in few days (fixes and support for 2.2" display.)

Share this post


Link to post
Share on other sites
Which display? I have had similar issue with JD-T and I think I fixed it by adding soft reset. In any case, I will be posting updated library in few days (fixes and support for 2.2" display.)

Yup, its still with the JD-T, mind showing how you implemented that soft reset? My added delay still doesn't fix it %100 of the time. Can't figure out for the life of me why it sometimes fails to init.

Share this post


Link to post
Share on other sites

This is what I have.

If you still have problems, add delay(50) before SWRESET and see if that helps.

 

...
writeCommand(SWRESET);
delay(20);
writeCommand(SLEEPOUT);
delay(20);
...

Share this post


Link to post
Share on other sites

Anyone else doing much with the Color LCD booster pack? I ported over most of the Adafruit graphics library. Still sorting out drawing a bitmap. It works in single color but nothing multicolor yet. I also want to make better "rounded rectangles" as well -this needs a better arc function.

 

There was an incident with the display after wrapping a usb cable to it with a rubber band. Broke most of the solder joints on the ribbon cable. So, while repairing that, I also cut the traces for SCE on 1.2 and moved it to 1.0. You can just see the 26g wire making the connection at 1.0.

 

 

Share this post


Link to post
Share on other sites

Yeah, that evalbot gets into all my projects. Best dev board yet. Wish I could grab another at the $25 price from a while back.

 

The Panavise is the 201 with the 'speed handle'.

 

I'm tempted to grab the last LCD kit you have in stock...

Share this post


Link to post
Share on other sites

Just FYI.

In a couple of weeks, I will be updating this library with the following:

 

support for HX8340 (2.2" LCD)

support for ILI9225 (2.2" LCD with touch panel)

landscape/portrait switch

most likely G2xxx/F5510 switch, possibly Stellaris LP

additional font sizes

various fixes and new functions

 

drawRoundRect (rounded rectangle)

fillRoundRect

 

drawLogicLine (see picture below)

drawLogicLineComp (compressed version of above)

multichannel versions of the above two

 

drawGrid, drawGridV, drawGridH, drawTickMarks

 

drawLabel (rect with the text, see buttons in the pic below)

drawRoundLabel

fillLabel (see rect with "Logic Analyzer")

fillRoundLabel

 

 

Any suggestions?

 

 

post-197-135135567667_thumb.jpg

Share this post


Link to post
Share on other sites

On the library update - if you are adding additional font bitmaps for larger text (rather than just scaling existing one)

could consider adding facility to select which parts of the font you actually need.

 

(e.g. if one only needs digits in large size, don't include all the bitmaps for the letters).

Might be able to do this with a few symbol definitions/ifdefs to cover major blocks of

data (e.g. Digits, Uppercase, Lowercase)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×