1.8" TFT LCD w/joystick and SD card. white screen
Moderators: adafruit_support_bill, adafruit

1.8" TFT LCD w/joystick and SD card. white screen

by asteroide06 on Sat Feb 02, 2013 8:18 am

Hello,

I just received an Adafruit shield, Adafruit 1.8" 18-bit Color TFT Shield w/microSD and Joystick, ID 802.
I connect it on an Arduino Mega 2560. As many other users, when upload any of the exanples provided with ADAFRUIT8ST7732 library examples, the screen is always white. The serial monitor shows a normal behavior. I can read the messages, the values of the analog reading with the joystick, etc... I changed the CS value to 10 and DC value to 8, according to the pin numbering on the shield. I double checked the solderings, redid them to make sure they make a good contact. No change.
You can see pictures of the solderings here:
http://www.asteroide06.fr/soldering1.jpg
http://www.asteroide06.fr/soldering2.jpg
They are not perfect (done with a smartphone)

What else can I try ?

Thanks for your help
asteroide06
 
Posts: 4
Joined: Sat Feb 02, 2013 8:02 am

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by asteroide06 on Sat Feb 02, 2013 8:03 pm

Ok, I got the solution. In the examples provided, the sclk and mosi pins must be used too. I first changed only the CS, DC and RST adresses. It's not enough to make it fully functional on an Arduino mega 2560.

For example in graphicstest, the original code is:
Code: Select all | TOGGLE FULL SIZE
#define sclk 4
#define mosi 5
#define cs   6
#define dc   7
#define rst  8  // you can also connect this to the Arduino reset


To make it work with Arduino mega 2560:
Code: Select all | TOGGLE FULL SIZE
#define sclk 13
#define mosi 11
#define cs  10
#define dc   8
#define rst -1  // you can also connect this to the Arduino reset


In shieldtest, the original code is:
Code: Select all | TOGGLE FULL SIZE
#define SD_CS    4  // Chip select line for SD card
#define TFT_CS  10  // Chip select line for TFT display
#define TFT_DC   8  // Data/command line for TFT
#define TFT_RST  -1  // Reset line for TFT (or connect to +5V)
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);


To make it work with Arduino mega 2560:
Code: Select all | TOGGLE FULL SIZE
#define sclk 13
#define mosi 11
#define SD_CS    4  // Chip select line for SD card
#define TFT_CS  10  // Chip select line for TFT display
#define TFT_DC   8  // Data/command line for TFT
#define TFT_RST  -1  // Reset line for TFT (or connect to +5V)
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, mosi, sclk, TFT_RST);


Hope this helps.
asteroide06
 
Posts: 4
Joined: Sat Feb 02, 2013 8:02 am

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by dmpyron on Thu Feb 07, 2013 12:22 am

Thanks for doing my research! :D Now I won't wander around trying to figure what little thing I've done wrong.
dmpyron
 
Posts: 35
Joined: Mon Dec 10, 2012 11:14 am

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by unexpectedly on Tue Apr 02, 2013 5:31 pm

Thank you so much!

Adafruit, please put something somewhere in the description about Mega people seeing this thread. :D

Yaaay, now I can get back to trying to use this to control my test bench... AND get a graph readout!

Thanks,
Chris
Last edited by unexpectedly on Fri Nov 01, 2013 3:25 am, edited 1 time in total.
unexpectedly
 
Posts: 42
Joined: Sun Nov 25, 2012 4:08 am

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by unexpectedly on Tue Apr 02, 2013 5:37 pm

these aren't the droids we're looking for, move along...
Last edited by unexpectedly on Fri Nov 01, 2013 3:26 am, edited 1 time in total.
unexpectedly
 
Posts: 42
Joined: Sun Nov 25, 2012 4:08 am

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by peony3000 on Wed May 01, 2013 11:43 am

Hi
I'm was getting the white screen with a Arduino Uno
The correct pin assignments are....
Code: Select all | TOGGLE FULL SIZE
// You can use any (4 or) 5 pins
#define sclk 13
#define mosi 11
#define cs   10
#define dc   8
#define rst  -1  // you can also connect this to the Arduino reset

Andy

peony3000
 
Posts: 4
Joined: Wed Apr 17, 2013 3:23 pm

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by adafruit_support_mike on Wed May 01, 2013 4:58 pm

This is an issue we started seeing with a small number of TFT shields after pburgess, our blinky-stuff guru, optimized the library. Unfortunately, it hits so rarely that he hasn't been able to replicate the issue and fix it.

Try using this version of the library: https://github.com/adafruit/TFTLCD-Libr ... 5263787d1f
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10882
Joined: Thu Feb 11, 2010 2:51 pm

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by unexpectedly on Wed May 01, 2013 7:58 pm

BTW, to update, I was able to get it working to the point where a joystick move could make words show up on the screen. I forgot exactly what I did, but I recall it was an issue of getting all the pin #s right on my Mega. If someone comes here via google with a Mega and is stuck ,reply and I'll dig up the sketch.
unexpectedly
 
Posts: 42
Joined: Sun Nov 25, 2012 4:08 am

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by v=f lambda on Fri Dec 06, 2013 9:50 am

BTW asteroide06's fix for shield test on the mega also works with the yun. Is there a way of clearing a single line on the screen or clearing the whole screen really fast?
tft.fillScreen(0x0000);
or
tft.fillScreen(ST7735_BLACK);
cause a 2-3 second delay in my sketch and i'm using network time on the yun and would like to be able to do it in under a second
v=f lambda
 
Posts: 6
Joined: Fri Dec 06, 2013 9:13 am

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by unexpectedly on Fri Dec 06, 2013 4:29 pm

You have to manually draw a black box in that area. Or print out " " to cover the space.

When I ported the Adafruit GFX library to work on chipKIT products, I added some features:
1) Current cursor position, so you can save a local variable for the X,Y of text you want to update. Then you have temx and tempy for current cursor position, allowing you to go to the other place, update text, then setcursor back to where it currently is.
2) Actually implemented their "background color" so that when I print text somewhere, it blanks out the background of the character.
3) Text inversion, so that it's easy to invert letters for maximum highlighting and easiest implementation.
... so you can review the changes I made to the GFX.cpp for these simple updates.

Also, the chipKIT uc32 is SO FAST that a fill screen is almost a blink! So you can just buy one of these instead and the Adafruit GFX library I linked to is TURN KEY.

:D Chris
unexpectedly
 
Posts: 42
Joined: Sun Nov 25, 2012 4:08 am

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by v=f lambda on Sat Dec 07, 2013 7:39 am

Thanks;
tft.fillRect(2, 30, 100, 30, ST7735_BLACK);
works a fair bit faster. Its just a lot of playing to get the box the right size and in the right spot.

Thank you for your help
v=f lambda
 
Posts: 6
Joined: Fri Dec 06, 2013 9:13 am

Re: 1.8" TFT LCD w/joystick and SD card. white screen

by unexpectedly on Mon Dec 09, 2013 8:35 pm

I use variables for X and Y position. The font sizes are fixed, so you can have #defines for row height and cursor. I did all my computation first then with X,Y at the top, Id do a row of text, increment Y by row height+margin. Thinking back, row height was 8, and I made margin 2.

In doing all that sillyness is why I added the getcursor() method to GFX...
unexpectedly
 
Posts: 42
Joined: Sun Nov 25, 2012 4:08 am



cron