RobG

(Universal) Color LCD graphics library (2)

118 posts in this topic

I just received 2 of  the "Color LCD Booster Pack 2.4 320 x 240 opt touch panel". I am using CCS IDE with the display mounted on a MSP430F5529LP. 

 

Do you have a demo/library or know where I can find one that will help me get started working with this display board? 

Share this post


Link to post
Share on other sites

I was able to find success after changing the configuration pins in config.h and msp.h in the ugl16msp library. Thanks!

bluehash likes this

Share this post


Link to post
Share on other sites

I decided to dust off my MSP430G2553 launchpad again and try and use it for a new proof of concept prototype application which needs either an OLED or small TFT display screen. So naturally one starts with a quick online google search to see what is out there currently. Searching for ILI9340 and MSP430 threw up this post. Happy day's I thought, this will speed things up on the TFT side as very little is out there. 

 

As you know there are 2 IDE's and coding methodologies I can use for the MSP430's. There is the quick and simple Energia and there is the more comprehensive Eclipse-based CCS.

 

So why is no one in the 43oh community being explicit in their documentation and explain to us users, who stumble across your fantastic work, as to exactly which IDE applies. The community needs to embrace Energia and not just assume that CCS is best for all things great and small, and then create their respective libraries in the correct format for both IDE's, and make mention of this in the readme files. I am left having to assume which IDE applies.

 

So if you have correctly formatted Energia libraries (typically just requires the right file structure) for ugl16msp and ugl8msp please could you let me know.

 

Thanks

 

-----------------------------------------------

 

Ok progress has been made.... and decided to update my own post.

 

So some 90 minutes later I eventually came across this post buried in this thread from @@RobG (on page 4 written over a year ago) which explicitly makes comment that this library is for CCS and that if one wants to get an Energia compatible library then one must click on this link (http://forum.43oh.com/topic/3911-energia-library-lcd-screen-library-suite/) which is yet another multipage forum post under section MSP Energia libraries. That takes you to this website:  http://embeddedcomputing.weebly.com/lcd_screen-download.html .

 

So thanks to those who created these libraries... your work is really appreciated.... we just need to find a better way to handle document structure and documentation to help us folks who decide to embark on proving a new idea navigate through this data overload.

Share this post


Link to post
Share on other sites

When I started ugl thread, Energia was in its infancy and your choice of IDE was either CCS or IAR.

I will try to find time to clean up some of my posts, but with so many things going on right now ( personal life, day job, hobby world, TI world,) that might take a long time.

Share this post


Link to post
Share on other sites

Thanks! Its working on MSP430G2553 and TFT177F254FPC from aliexpress. http://ru.aliexpress.com/item/1-8-Serial-TFT-Color-LCD-Display-Module-With-SPI-Interface-5-IO-Ports-128X160/1887213993.html

 * Pinout:
 LCD   MSP430
1 NC - NC
2 VSS - GND
3 LED - GND
4 LED - via 20Ohm to +VCC 3v3
5 VSS - GND
6 /RET +VCC 3v3
7 A0     - P1.4
8 SDA  - P1.7
9 SCK  - P1.5
10 VDDA +VCC 3v3
11 VDDIC +VCC 3v3
12 /CS - P1.0
13 VSS - GND
14 NC - NC

Share this post


Link to post
Share on other sites

Seems is the mistake with color here.

After "setColor(COLOR_16_RED);" digit printed be BLUE and vice versa. May be here reversing bit order?

Share this post


Link to post
Share on other sites

I had the same "issue" with some chinese displays. Could be the displays them self. Not that big issue to work around though.

 

L

Share this post


Link to post
Share on other sites

I will take a look once I find some time, but this could be caused by different default settings of the display driver (I am setting only few basic things in configuration function.)

Should be an easy fix.

WilliamCampolina likes this

Share this post


Link to post
Share on other sites

I will take a look once I find some time, but this could be caused by different default settings of the display driver (I am setting only few basic things in configuration function.)

Should be an easy fix.

 

Yeah, it looks like RGB vs BGR colour ordering. I guess the displays that do this need some specific setup to pick the right mode. If they don't offer a setting for component order then the red and blue bits would need to be swapped in setColor.

Share this post


Link to post
Share on other sites
I have a msp430f5529'm using your lib ... however if I for example put

 

while (1) {

    clearscreen (1);

    setColor (COLOR_16_WHITE);

    drawString (5, 0, FONT_MD, "Menu");

}

 

in a while ... I can see it flashing ... is this normal? I thought it would blink so fast I could not see ...

 

if you can help me guide me too ... if I'm making a menu

Share this post


Link to post
Share on other sites

Hi Rob, 

 

I am trying to test your LCD on a CC3200 and the MSP430FR4133 launchpads - I have changed the pins for each board, however your code does not compile, giving such as "P1SEL is undefinded, P2SEL is undefined" and about 8 other definition errors. I'm not sure if there is a header file that I've misplaced or if the code is just not compatible with my boards.  Any help with getting the glass to work on my boards is appreciated!

 

Thanks

Share this post


Link to post
Share on other sites

Yeah, it looks like RGB vs BGR colour ordering. I guess the displays that do this need some specific setup to pick the right mode. If they don't offer a setting for component order then the red and blue bits would need to be swapped in setColor.

This was the case, at least for me. According to the datasheet I have for this display, the RGB/BGR direction is controlled by HW pin, so I made the following changes to the code in graphics.c file.

void setColor(u_int color) {
#if defined SWAP_TO_BRG
    colorLowByte = (color & 0x07FF) << 11 | (color & 0x07E0) | (color & 0xFFE0) >> 11;
    colorHighByte = ((color & 0x07FF) << 11 | (color & 0x07E0) | (color & 0xFFE0) >> 11) >> 8;
#else
    colorLowByte = color;
    colorHighByte = color >> 8;
#endif
}

void setBackgroundColor(u_int color) {
#if defined SWAP_TO_BRG
    colorLowByte = (color & 0x07FF) << 11 | (color & 0x07E0) | (color & 0xFFE0) >> 11;
    colorHighByte = ((color & 0x07FF) << 11 | (color & 0x07E0) | (color & 0xFFE0) >> 11) >> 8;
#else
    bgColorLowByte = color;
    bgColorHighByte = color >> 8;
#endif
}

Then I just defined "SWAP_TO_BRG" and the colors work as they should.

I know this is old discussion, but decided to post this anyway in hope that it might be helpful to someone.

RobG and tripwire like this

Share this post


Link to post
Share on other sites

@@RobG Sorry for bumping this up,

but somehow I get the error:

 

 

Error[e46]: Undefined external "_delay_cycles" referred in main ( C:\Users\ulix\Documents\MSP430\display\Debug\Obj\main.r43 )

 

Where is the function: _delay_cycles defined and why do I get this error?

 

thanks

Share this post


Link to post
Share on other sites

@@RobG Sorry for bumping this up,

but somehow I get the error:

 

 

Where is the function: _delay_cycles defined and why do I get this error?

 

thanks

What IDE are you using? Function _delay_cycles() is part of the msp430 framework (<- I may not be using right word here?) in CCS (Code Composer Studio IDE).

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