RobG

(Universal) Color LCD graphics library (2)

118 posts in this topic

I had to install the IAR IDE at home with the 30 day evaluation not kickstart to get it to work.

 

One last no0b/student question. If i wanted to generate a picture to display, how would i do that, kind of like how you have the TI logo, but i want to make it a real random picture.

 

Thanks a lot!

Share this post


Link to post
Share on other sites

Hi,

 

I just bought one o your LCD shield I'm using Energia, is your library easy to use with it, or does it require CSS?

 

Regards

Share this post


Link to post
Share on other sites

I have ported a readRegister() function from ENERGIA.

 

At 16MHz SPI clock it gives incorrent results, altough RobG's wrinting functions work corretly at this speed (LCD displays as it should).

At 8MHz reading works correcty too.

unsigned char readRegister(unsigned char Addr, unsigned char xParameter)
{
	//ENERGIA
    //INT8U data=0;
    //sendCMD(0xd9);                                                      // ext command
    //WRITE_DATA(0x10+xParameter);                                        // 0x11 is the first Parameter
    //TFT_DC_LOW;
    //TFT_CS_LOW;
    //SPI.transfer(Addr);
    //TFT_DC_HIGH;
    //data = SPI.transfer(0);
    //TFT_CS_HIGH;
    //return data;

	unsigned char data = 0;
	writeCommand(0xd9);
	writeData(0x10+xParameter);
	LCD_DC_LO;
	LCD_SELECT;
	UCB0TXBUF = Addr;
	while (UCB0STAT & UCBUSY);
	LCD_DC_HI;
	UCB0TXBUF = 0;
	while (UCBxSTAT & UCBUSY);
	data = UCB0RXBUF;
	LCD_DESELECT;

	return data;
}

Reading ILI9341's register 0xD3 ("Read ID4") must be the value of "0x09341"

    for( i=0; i<3; i++ )
    {
        rx_data[i]=readRegister(0xd3,i+1);

    }

Share this post


Link to post
Share on other sites

Hi RobG. I wonder if you can help me. I have bought 2.2" TFT + touchscreen with ILI9225B. The ebay seller did not have any data sheet for it. With google I found some old thread in EEVBlog forum by some one called Tinkeringsteve. Futher investication in to the thread, revealed couple post by some one called RobG. Hmm... In one of his posts (reply #13) I found couple of pictures from his LCD screens and the one in the right side looks exactly as mine. Also Tinkeringsteves ebay links look exactly the same LCD as I appear to have.

 

So do you have any information about the screen? Datasheet? How do I connect it to the lauchpad to be used with your LCD library? Pinout? All and any information is verry mutch appriciated.

Thank you.

 

I attached couple images of the LCD if it is any help.

post-17164-0-88373900-1392231319_thumb.jpg

post-17164-0-05029200-1392231334_thumb.jpg

Share this post


Link to post
Share on other sites

@@Tieri,

 

you can use my ugl8 library (see first post) with your LCD, it's the same one I used in my v1 BP.

I have some PCBs left if you want.

Thank you for your swift responce. Found the schematics for your PCB in the thread. They helped a lot. I have now the confidence to hook up my display and try it out. The thing that was confusing me most was the SOMI line. But It seems I can leave it unconnected, as the display has no SOMI line. The pinout I had was refering the MOSI/SOMI line was combined.

 

No need for the PCB as this baby is goin straight to a project as I get the hang of it and your library.

 

Thanks again for your great work!

Share this post


Link to post
Share on other sites

Hi RobG,

your library looks really neat! I would like to try to it out. Finding an LCD locally would be a lot easier than having one shipped. Do you happen to know any phone models the 320x240 screens are used in? Can you tell me what is written on the back of the LCD?

 

Thanks! Looking forward to trying it.

Share this post


Link to post
Share on other sites

Updated my ugl16 library with few new functions:

u_int color = getPixel(x, y); //returns color of the pixel at x and y

getPixels(xStart, yStart, xEnd, yEnd, data); //returns color of the pixels from the defined area

To read registers:

readDataBegin(command);
u_char data = readData();
// repeat readData() if necessary
readDataEnd();

To read id:

u_int id = readID();

Share this post


Link to post
Share on other sites

Hey Rob,

 

I was just curious as to how difficult it would be to port this (or ugl 8) to be compatible with an SSD1289 display. The libraries I am currently using are not nearly as well commented (and are therefore much more difficult to code for).

Share this post


Link to post
Share on other sites

Nevermind. It would seem that porting is unnecessary. Although the datasheet for the item I purchased lists the LCD controller as an SSD1289.... a device teardown CLEARLY shows that it is using an ILI9341. Gotta love China stuff. The better question would be what exactly needs to be changed between a ILI9341 and an ILI9340?

Share this post


Link to post
Share on other sites

That's what I'm seeing. However, I'm trying to get the pinout done. I noticed a couple pin definitions in config.h (for CS and DC). I'm using a 5529LP, but the screen I am using includes D0-D15, RS, CS, RD, WR, and RST, Where exactly is the DC port going to? Do you have the rest of the pin definitions in the code, or do I need to create them myself?

 

Sorry for my ignorance. I'm not as familiar with the Launchpad as I'd like to be.

Share this post


Link to post
Share on other sites

@@RobG I've also found the pin definitions for MOSI, MISO, and SCLK. I'm assuming the MOSI and MISO pins go to RD and WR (or vice versa). CS would go to CS, and SCLK would go to RS (different pin from the RESET pin). That would leave RESET and BL_CNT unused, as well as leaving the D0-D15 pins unused. Am I correct in this assumption? I'm working on adjusting the pin definitions in msp.h and config.h in order to fit the layout given in the MSP430F5529 pin layout that comes in the box, but am not having any luck as of yet (white screen... no data to screen). I still have no idea where to connect the DC pin listed in your headers, though.

 

This library seems to be MUCH lighter weight than the one I am currently using, so I'd hate to have to go back to the other one.

 

Edit: There is also an SD_CS pin I neglected to mention before, because I believe it is for the SD card slot on the display. However, since my unit does not have explicitly labelled MOSI, MISO, SCLK, and D/C pins, will I be forced into using the D0-D15 + CS/RD/WR/RS setup rather than the SPI interface you have in your libraries?

Share this post


Link to post
Share on other sites

You have parallel LCD, my library is for serial.

DC is RS, CS is CS, do not use MISO, MOSI, or SCLK. I am not using D0-D15, WR, RD, and RST, so you have to add it yourself.

You will need to rewrite writeData and writeCommand to use parallel instead of serial.

Share this post


Link to post
Share on other sites

Updated MSP430 library for 8 bit displays (fixed problem with F5xxx chips)

 

Moved Tiva libraries to Stellarisiti site

 

see original post

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