chipKIT® Development Platform

Inspired by Arduino™

Adafruit 2.8" TFT LCD Library

Created Mon, 10 Sep 2012 21:43:54 +0000 by zulucat


zulucat

Mon, 10 Sep 2012 21:43:54 +0000

I've ported Adafruit's 2.8" LCD library (TFTLCD) to a uC32 processor board. With one exception the port works fine. The problem is that when running the graphics test program (graphicstest) a horizontal line is missing. The missing line appears to be in the same location all the time.

On the off chance that what I'm seeing is a problem with only my board I've attached the library code to the post. Perhaps someone on the forum has an Adafruit 2.8 " TFT LCD display and is willing to set it up and see if they can duplicate the problem. Note that files have been renamed so as to avoid confusion with Adafruit's original files. HOOKUP.TXT shows you what pins to use.


chow@vajri.com

Tue, 11 Sep 2012 03:51:00 +0000

I glanced at the library and example sketch. Looks like the sketch loops through various graphics. Is the screenshot you show from

testFillRoundRect();

??


zulucat

Tue, 11 Sep 2012 05:05:02 +0000

That's a photo of testfastlines(). Most of the tests fail like that at one time or other. Its not 100% of the time but it happens often enough to be a worry.

I did the library port to support an app I'm working on. I've built a demo screen which is pretty simple compared to the graphics test program. It clears the screen, creates some boxes, labels the boxes, put data in the boxes and then periodically updates the data. This works all the time!

Also, the fillScreen() function works ALL the time. I would have thought that it would be a good candidate for failure. But Nooooo …

At this point I don't what else I can do to isolate the problem. That's why I've asked for help.


dragonbot

Wed, 26 Sep 2012 19:33:23 +0000

Hi Zulucat, I am migrating over my code from Arduino to Chipkit as well. I saw your zipped library and thought I will play with it. I tried the example you provided, when I compile the example, I get:

ckGraphicsTest.cpp:45:19: fatal error: CKTFT.h: No such file or directory compilation terminated.

This has to be something obviously simple since this is step 1.

Could you please help? I would really appreciate it ! Thanks!

DB


EmbeddedMan

Wed, 26 Sep 2012 21:05:34 +0000

How fast are you clocking bytes out to the display with the chipKIT? It's going to be way faster than on an Arduino, and you may be violating some of the timing specs of the display driver chip. You should get it on a scope or LA and check the timing I think.

*Brian


zulucat

Thu, 27 Sep 2012 05:16:06 +0000

ckGraphicsTest.cpp:45:19: fatal error: CKTFT.h: No such file or directory compilation terminated.

I had a similar problem when I first started using MPIDE. The problem was fixed by putting the library in the "mpide" folder created by MPIDE. If it doesn't already exist you'll need to make a "libraries" folder under "mpiide". Put CKTFT in the "libraries" folder. Your path should look like this:

MyDocuments\mpide\libraries\CKTFT (Windows)

Document -> mpide -> libraries -> CKTFT (MAC)

Let me know if this fixes the problem.


zulucat

Thu, 27 Sep 2012 05:27:26 +0000

How fast are you clocking bytes out to the display with the chipKIT? It's going to be way faster than on an Arduino, and you may be violating some of the timing specs of the display driver chip. You should get it on a scope or LA and check the timing I think. *Brian

You're right about it running faster -- about 9 times faster than an Arduinio UNO. I've looked at the signals being generated by the uC32 and they exceed the minimum times required by the ILI9325 by a comfortable margin.

The ILI9325 doesn't have a busy bit so that initially I thought I might be overrunning the ILI9325's ability to process data. However, the function fillScreen(), which writes the most data the fastest, never fails.

I wrote a simple test program that fills the screen with a series of horizontal lines and this occasionally fails. But filling the screen with a series of vertical lines never fails.

This whole thing has got me scratching my head. :shock:


dragonbot

Thu, 27 Sep 2012 15:13:23 +0000

Hi Zulucat,

  1. Thanks for the tip on the creating the directory and installing your lib as : MyDocuments\mpide\libraries\CKTFT ... Unfortunately this did not help. I restarted the mpide, and recompile the example - I still get: ckGraphicsTest.cpp:45:19: fatal error: CKTFT.h: No such file or directory compilation terminated.

Do you remember doing anything else to make this work?

  1. For the missing graphic line on your LCD, have you considered the possibility that one of the pins on your CK is bad? I ran into this last evening with my new CK. I have a servo motor that will not work on the uC32 when connected to pin 10, but works fine on few other pins. I am using the knob servo test program. Still troubleshooting this. [EDIT: Nevermind - pin 10's jumper needed to be switched: http://chipkit.org/wiki/index.php?title=Uno32_Digital_Pin_10 ]

[EDIT: Still consider pins' jumpers/ or malfunction as here:] Then I saw this link: http://www.chipkit.org/forum/viewtopic.php?f=17&t=1068 Sure enough - similar issue, pinout not working.

Perhaps try to use different set of pins to signal your LCD?

D.


dragonbot

Thu, 27 Sep 2012 15:54:34 +0000

This is real silly - If I add the entire path to the example & the CKTFT.cpp then it compiles ok, i.e. :

#include "C:\mpide-0023-windows-20120903\libraries\CKTFT\CKTFT.h" #include "C:\mpide-0023-windows-20120903\libraries\CKTFT\glcdfont.c"

gets me to: Binary sketch size: 27296 bytes (of a 126976 byte maximum)

I will see if I can add this to my ENV path.

D.


zulucat

Thu, 27 Sep 2012 18:58:36 +0000

This is real silly - If I add the entire path to the example & the CKTFT.cpp then it compiles ok, i.e. : #include "C:\mpide-0023-windows-20120903\libraries\CKTFT\CKTFT.h" #include "C:\mpide-0023-windows-20120903\libraries\CKTFT\glcdfont.c" gets me to: Binary sketch size: 27296 bytes (of a 126976 byte maximum) I will see if I can add this to my ENV path. D.

You stored the CKTFT library in the wrong place. Again, it should go into

My Documents\mpide\libraries

After storing CKTFT in the "proper" place open MPIDE and click on the open file button. You should see something like this:

Click on "libraries", then CKTFT and then ckGraphicsTest,

Don't forget to change the #include statements back to the original.


dragonbot

Wed, 03 Oct 2012 19:28:25 +0000

Hi Zulucat,

  1. Are you still getting that horiz line missing? Would you like me to test on my setup of chipkit & LCD panel?

  2. Have you also ported the touch screen library from adafruit? (TouchScreen).

  3. In your mind was this port worth it? Or do you think utilizing the existing UTFT library would have been fine for your needs.. I am at this cross road as well. Perhaps it won't be too hard changing all my functions I used from adafruit's library to UTFT's library functions. There are not a whole lot of them anyway and most seem to have same or similar parameters.

Either way, missing TouchScreen library on your port might be a show stopper for me.

Let me know if you need me to do the #1 above to validate the horiz line issue.

Thanks! D.


zulucat

Thu, 04 Oct 2012 17:13:28 +0000

  1. Still have the missing line. Yes! I'd appreciate any help you can provide.

  2. No I haven't. As I recall the Touch Screen library turned week pullups on & off when reading the TS. I seem to have read a post here on the forum that mentioned that chipKIT boards didn't have week pullups. However, I ran across some info in the PIC32 docs that discusses a register that can be used to enable week pullups. I still need to do some more work in that area.

3a) Yes. I ended up learning a fair amount about PIC32 I/O in the process. So, I'm glad I did the port.

3b) I looked at the UTFT library and I didn't see anything that specifically mentioned the Adafuit TFT display. Since I'd already hooked up the display to an UNO I knew that both the display and the Adafruit library worked so I decided to go from there. However,, the UTFT library supports the ILI9325 display chip so it should work just fine

Since you need TS support I'd go with UTFT. Who knows when (if ever) I'll get my port done.

Good luck on your project - Doug