Jump to content
RobG

(Universal) Color LCD graphics library (2)

Recommended Posts

Hi, @RobG:

First thank you for sharing your lib and giving answers for new users as well. :)

I'm in the task to get a 1.8" TFT Color 160x132 sd_card display with (ST7735; HY-1.8 SPI) running on msp430g2553 Launchpad 1.5.

 

I'm a bit unsure if I should use the 8bit or 16bit lib.

I mean the datasheet of the ST7735 says:

9.7.15 3-line serial Interface
Different display data formats are available for 
three colors depth supported by the LCM listed below.
4k colors, RGB 4-4-4-bit input
65k colors, RGB 5-6-5-bit input
262k colors, RGB 6-6-6-bit input 

So it seems it is software configurable.

 

I'm tending to use the ugl16 but in your opening posts you wrote ugl8 for the st7735.
But clicking of the provided link lead me to the 2.2" Display.

 

Next uncertainty for me is the using of the reset pin and the wiring in common. Would you give me an advice?

 

??                                        Pin 07 (A0)
LCD_CS_PIN       P1.0    Pin 10 (CS)
LCD_MOSI_PIN   P1.7    Pin 08 (SDA)
LCD_SCLK_PIN   P1.5   Pin 09 (SCK)
??                                        Pin 06 (RESET)
 

 

So, I miss LCD_DC_PIN BIT4 and LCD_MISO_PIN BIT6

 

 

Once I have the display in my hands and running I will provide the wiring, thinking it might be helpful for noobs like me.

Share this post


Link to post
Share on other sites

You have to use ugl8 for ST7735.

 

You don't need MISO unless you want to use SD card.

DC is RS/DC pin on ST7735 running in 4 wire mode.

If your LCD uses ST7735 in 3 wire mode (9 bit SPI,) then this library will not work as is. Older versions of my glib do have 9 bit support, but you can only use software SPI.

 

RESET on my BPs has its own circuit, simple RC, so you will either have to add RC(47k, 0.1uF) or use a spare pin.

Share this post


Link to post
Share on other sites

Hi RobG,

I just received my color LCD boosterpack and i was trying to implement bigger font on it.

I tried to use GLCD font creator to convert a .ttf font to an array of hex, but the array doesn't seem organised in the same way the array in font.h are.

Also, because the font I want is way bigger, the resulting array is really big, so is taking way to much memory space.

If you could give me some insight on how to do that it would be great.

Thanks

Share this post


Link to post
Share on other sites

I would like to have a 48pt and/or 72pt font. I tried the 48pt first, and the .h output of GLCD (font.h) is 111kB (around half of tiva lauchpad memory i think, wich is too much). Plus, the format of the array un the .h is weird. I tried with "The Dot Factory", now I understand the output array, but the .h file (font1.h) is way too big (405 kb). Is there a way to compress that?

Thx

font.h

font1.h

Share this post


Link to post
Share on other sites

i want to ask same. How you get font to hex ? I need big numbers (48-70px). I tried some programs, best was The Dot factory, but i wasnt able draw it on display. I try modify 

void drawCharSmBkg(u_char x, u_char y, char c) {
	u_char col = 0;
	u_char row = 0;
	u_int  bit = 0x01;
	u_char oc = c - 0x20;
	setArea(x, y, x + 49, y + 63); // 4 and 7 change to actual width and height -1

	while (row < 64) { //same here
		while (col < 51) { //same here 
			if (BIG_FONT[oc][col] & bit) {
				//foreground
				writeData(colorHighByte);
				writeData(colorLowByte);
			} else {
				//background
				writeData(bgColorHighByte);
				writeData(bgColorLowByte);
			}
			col++;
		}
		col = 0;
		bit <<= 1;
		row++;
	}
}

and font is : 

const uint BIG_FONT[] = 
{
	// @0 '0' (38 pixels wide)
	0x00, 0x07, 0xFF, 0xC0, 0x00, //              #############            
	0x00, 0x3F, 0xFF, 0xF0, 0x00, //           ##################          
	0x00, 0xFF, 0xFF, 0xFC, 0x00, //         ######################        
	0x03, 0xFF, 0xFF, 0xFF, 0x00, //       ##########################      
	0x07, 0xFF, 0xFF, 0xFF, 0x80, //      ############################     
	0x0F, 0xFF, 0xFF, 0xFF, 0xC0, //     ##############################    
	0x0F, 0xFF, 0xFF, 0xFF, 0xC0, //     ##############################    
	0x1F, 0xFF, 0xFF, 0xFF, 0xE0, //    ################################   
	0x3F, 0xFF, 0xFF, 0xFF, 0xE0, //   #################################   
	0x3F, 0xFF, 0xCF, 0xFF, 0xF0, //   ################  ################  
	0x3F, 0xFF, 0x07, 0xFF, 0xF0, //   ##############     ###############  
	0x7F, 0xFF, 0x03, 0xFF, 0xF0, //  ###############      ##############  
	0x7F, 0xFE, 0x01, 0xFF, 0xF8, //  ##############        ############## 
	0x7F, 0xFE, 0x01, 0xFF, 0xF8, //  ##############        ############## 
	0x7F, 0xFE, 0x01, 0xFF, 0xF8, //  ##############        ############## 
	0x7F, 0xFE, 0x01, 0xFF, 0xF8, //  ##############        ############## 
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0xFF, 0xFC, 0x00, 0xFF, 0xFC, // ##############          ##############
	0x7F, 0xFE, 0x01, 0xFF, 0xF8, //  ##############        ############## 
	0x7F, 0xFE, 0x01, 0xFF, 0xF8, //  ##############        ############## 
	0x7F, 0xFE, 0x01, 0xFF, 0xF8, //  ##############        ############## 
	0x7F, 0xFE, 0x01, 0xFF, 0xF8, //  ##############        ############## 
	0x3F, 0xFF, 0x03, 0xFF, 0xF8, //   ##############      ############### 
	0x3F, 0xFF, 0x87, 0xFF, 0xF0, //   ###############    ###############  
	0x3F, 0xFF, 0xCF, 0xFF, 0xF0, //   ################  ################  
	0x1F, 0xFF, 0xFF, 0xFF, 0xE0, //    ################################   
	0x1F, 0xFF, 0xFF, 0xFF, 0xE0, //    ################################   
	0x0F, 0xFF, 0xFF, 0xFF, 0xC0, //     ##############################    
	0x07, 0xFF, 0xFF, 0xFF, 0xC0, //      #############################    
	0x07, 0xFF, 0xFF, 0xFF, 0x80, //      ############################     
	0x01, 0xFF, 0xFF, 0xFF, 0x00, //        #########################      
	0x00, 0xFF, 0xFF, 0xFE, 0x00, //         #######################       
	0x00, 0x3F, 0xFF, 0xF8, 0x00, //           ###################         
	0x00, 0x07, 0xFF, 0x80, 0x00, //              ############             
};

and display show dots and lines. Except that library works fine. 

Share this post


Link to post
Share on other sites

@@right13, use drawCharMdBkg instead of Sm and add another loop between two existing ones.

8x12 has only one byte for each row, you have 5, and that's why you need that new loop.

Area has to be 40x48 looks like.

Share this post


Link to post
Share on other sites

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

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

×