Problems with Arduino MEGA 2560 and touch screen shield.

hi,
im new to arduino and all this....

i have an arduino UNO R3, an Arduino MEGA, a SD card shield, and a TFT touch shield V1. got them all at radioshack.

the arduino UNO works perfect with the touch shield, but the MEGA just STAYS IN WHITE. i dont know why.

the code uploads with no problem, its just the mega arduino.... no idea why this is happening... i even tried different libraries and different codes and none of them work with my mega.

any help please?

the code uploads with no problem

What code does?

It looks to me like the backlight is turned up way too bright.

I don't think the brightness is the problem here. This used to happen to me before when I first got my arduino UNO.

Some libraries didn't wanna work. But for some reason I only have one library working.

For example there is a library called "Adafruit_TFTLCD" and it has many examples in it but none of them work with my UNO. The only one I have that work with it is a library called "TFT" it has some nice examples and they work with my UNO. So yesterday I got my arduino MEGA and I tried the examples that work with my UNO and I mounted my touch shield exactly how I had it with my UNO and still it doesn't work.

Do I have to open the TFT.h file or the C+ file and modifi it? So it can with with my MEGA?

By the way.... Thanks for the fast response :slight_smile:

Do I have to open the TFT.h file or the C+ file and modifi it? So it can with with my MEGA?

Not all touch screens work with all Arduinos. Whether or not your will work with the Mega will remain a mystery until you identify (provide a link to) yours.

romny,
Find the driver of your TFT, just look on the back, find the UTFT library online by Henning.
Download,unzip,move to IDE library, restart IDE,and in one of the simple examples provided with the UTFT go about 10-12 lines into the code and uncomment out for your mega and screen. I.e. if I'm driving a SSD1963 off a mega I will choose myGLCD(SSD1963, 38,39,40,41)
Once you make this switch to the UTFT life will become considerably easier, well for TFTs at least.
Best of luck.

To PaulS.

Well the website says that it's compatible with MEGA.

And what do you mean by "will remain a mystery until you identify (provide a link to) yours."

Remember I'm new to this. Be more detailed so I can understand the complicated things you say.
My knowledge is not as high or expanded as yours is :slight_smile:

Thanks for your help!

And what do you mean by "will remain a mystery until you identify (provide a link to) yours."

I mean that you, and only you, know where you bought it/who made it. Unless you share that information, in the form of a URL/link, you will be on your own.

To 997_1

You want me to look for a "UTFT driver" for my touch screen shield?

I think I already did that. I downloaded some libraries for my screen from the website "www.seeedstudio.com"

My screen is the version 1 and its red on the back.

My screen works with UNO.

Arduino UNO and MEGA have the same pins. And what I did was just put the touch shield exactly how I put it on my UNO. But it didn't work.

Maybe I have to edit the code so it can work with MEGA.

You know what, ima make a video showing you guys what I'm doing showing you my files and everything.
That way maybe you guys can understand what I'm doing just in case I'm not explaining my sect correctly or clearly .

Also I will post the files i use with my UNO and MEGA.

Thank you so much for your help!!!
I really appreciate it :slight_smile:

Arduino UNO and MEGA have the same pins.

While the Mega has pins in the same place as the UNO, they are far from the same pins. SPI pins and I2C pins are in different places on the two boards. What are PWM pins on the Mega are not necessarily PWM pins on the UNO.

PaulS

Omg thanks for your fast response :slight_smile:
I'm feeling positive and I think I'll have my MEGA working with this touch shield :slight_smile:
......

Well, I bought my touch shield at RadioShack, but it's made by www.Seeedstudio.com

This is the link of it:
http://www.seeedstudio.com/depot/28-tft-touch-shield-p-864.html

PaulS,

Wow you gotta be kidding me!! They are not the same pins? Even though they are labeled with the same name?

Wow... Let me look at the data sheet of Arduino Mega.

Ok, this question might get you mad.
I mean it depend what type of person you are lol. Here is the question:
What are "PWM, SPI, I2C" pins?
I know you might tell me google it. But I'll appresiate it if you briefly tell what what they are or what they do or what they are used for :slight_smile:

PWM pins are Pulse Width Modulation pins. These pins can be turned on and off very quickly, making things like LEDs and motors run at different brightnesses/speeds, based on the duty cycle of the pin.

SPI is Serial Peripheral Interface, and is used to communicate with devices that use that interface, such as the Ethernet shield and most SD card readers/writers. The pins that make up SPI on the UNO are 11, 12, and 13. On the Mega, pins 50, 51, and 52 perform that role.

I2C - inter-IC communication, how two chips on the same board talk, uses different pins on the UNO and the Mega.

The actual pins used for a given purpose is hardware dependent, and is defined my Atmel, not the Arduino team.

Thank you!

I just copied and save that. Just in case I forget.

I'll post the video in a moment :slight_smile:

i was just messing with my arduino mega with the touch shield and still stays with WHITE screen but when i clicked on serial monitor i got this message:


TFT LCD test
using Adafruit 2.8" TFT Arduino Shield Pinout
Unknown LCD driver chip: 0
If using the Adafruit 2.8" TFT Arduino Shield, the line:

#define USE_ADAFRUIT_SHIELD_PINOUT
should appear in the library header (Adafruit_TFT.h).
If using the breakout board, it should not be #defined!
Also if using the breakout, double-check that all wiring
matches the tutorial.
0


what am i supposed to do there?
download the drivers as mentioned before?

their website says that i have to do this:

Note: For mega/mega2560 , you should change the 33 line "#define SEEEDUINO" to "#define MEGA" in the TFT.h

can i get some help with this?

idk how to mess with C+ code :slight_smile:

TFT.h (5.41 KB)

TFT.cpp (11.4 KB)

Did you look at line 33 of the header file? If looks exactly like the note says. Fire up your favorite editor and make the change. No magic smoke will be released!

hahahahahahah now it works lol

i used an applications called "Code::Blocks" to edit the .h file and now it works with my mega :slight_smile:

ok it works now, i changed the 33 line "#define SEEEDUINO" to "#define MEGA" in the TFT.h file

but it only works with the examples in the TFT library folder.
it doesnt work with other examples......

the files are here.... download it and look at it please...

Adafruit_GFX.h (3.44 KB)

pin_magic.h (11 KB)

Adafruit_TFTLCD.h (2.71 KB)

TFT.h (5.39 KB)

download it and look at it please...

Wouldn't do much good without a TFT. Can I borrow yours?

so, do you know why it doesnt work with other libraries?

Adabruit for example?