Loading...
Pages: [1] 2 3   Go Down
Author Topic: Sainsmart TFT touch SD shield, SD not working  (Read 4530 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I have a Sainsmart TFT touch shield with SD slot, connected up via a Sainsmart shield to a mega 2560. Using the UTFT and Utouch librarys I have gotten the display and touchscreen working fine, the only problem I'm having is that I cant seem to get the SD card function working. I have been using the UTFT_tinyFAT and the TinyFAT librarys, and when attempting to use the example demo_landscape sketch all I ever get is the message File not found.  The display module I'm using is SSD1289. I have formatted the SD card to FAT, which I'm assuming is FAT16 under windows 7, as it only gives options for FAT or FAT32, and I have placed all the demo image files into the root of the SD card. Has anyone else had this issue and found a work around?
Logged

France
Offline Offline
God Member
*****
Karma: 23
Posts: 655
Scientia potentia est.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is a bug on the adapter shield, you have to swap 2 of the SPI connections

Actual SPI connections are:

35 to 50
36 to 51
37 to 52
38 to 53



Must be corrected like this:

35 to 50
36 to 52
37 to 51
38 to 53

I know, it sucks! I have the same problem and still haven't fixed it.

One solution, remove the 2 resistors and solder 2 wires on the pads to swap:


Another solution, use 40 wires to connect the display to the adapter shield and just swap wires for pins 36 and 37.
« Last Edit: December 18, 2012, 04:49:42 pm by guix » Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the info. I was hoping that it was me missing something, and not badly built and untested hardware from Sainsmart, but I guess you get what you pay for! Now hopefully I wont mess up the board trying to do the modification.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I suspect this error is the reason for this

"It is the version of product only with touch screen and touch controller."

in the product description.

Can be somewhat misleading when the top of the page has "PCB adapter SD Slot" - always read the fine print  smiley
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can confirm that this modification does work. Afterwards the UTFT_tinyFAT examples now work correctly. I have attached a picture below, probably need to get better at soldering, but it works!

Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 336
Posts: 36467
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm. I have to wonder why there was a resistor there, then. I suspect that you should have replaced the surface mount resistor with an equivalent non-surface mount one, connected correctly.
Logged

France
Offline Offline
God Member
*****
Karma: 23
Posts: 655
Scientia potentia est.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good idea PaulS, first drill at the middle of the pads and then solder through hole 10k resistors... resistors on the backside? I will do that, neater than wires.

But I wonder too, what are all those resistors.
« Last Edit: December 19, 2012, 11:06:00 am by guix » Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Has anyone got any more info on whether the resistors are needed. So far i have only run the display for a few minutes at a time since the modification, and I haven't noticed any issues. Has anyone else done this and found issues without the resistors being there?
Logged

France
Offline Offline
God Member
*****
Karma: 23
Posts: 655
Scientia potentia est.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know almost nothing to electronics, but I believe they are current limiters, to make sure it does not exceed the Arduino pins current limitations... Here is what I think:

Those are 10000 Ohms resitors, Arduino pins output 5V when HIGH, so:

I (Amperes) = U (Volts) / R (Ohms) = 5 / 10000 = 0.0005A = 0.5mA. So those resistors make sure each pin of the display draw a maximum of 0.5mA from the corresponding Arduino pin. There are 32 resistors, so a maximum of 16mA is drawn by the display (not counting the backlight LEDs which are connected to 5V 3.3V by the trimmer pot), from the Arduino...

So if you remove those 2 resistors (which you did) and for example there is a short circuit on the SD slot, or by mistake you connect it to ground (smiley-confuse), you risk drawing more current from Arduino pins 51 and 52, maybe exceeding the maximum ratings, which could damage the pins (inside the AtMega chip). But... it is very unlikely smiley (I think)

Well that's my theory, I'm probably partially (or totally) wrong xD
« Last Edit: December 20, 2012, 12:20:09 pm by guix » Logged

Kelowna, BC Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

O.K. I'm totally new to all of this aspect of electronics.  A have just started tinkering with Arduino boards.  But as I look at the board in reply #4, I see the two yellow wires replacing the resistors.  Could you not determine the value of the resistor that you removed, and then instead of using the yellow wire, just replace with a regular resistor of the same value only in the same configuration that you now have with the yellow wires.

That's my 2 cents worth..

Harvey
in Kelowna, BC.
Logged

Harvey
in Kelowna, BC

0
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just an idea - but is the lcd 5v? or 3.3v? The resistors could be to reduce the 5v to 3.3 volt.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I bought the same board and had the same issue.  Would be nice if the manufacturer/designer would post this issue on their website so we at least are aware and people aren't having to re-troubleshoot all the time  smiley-mad.  I received my board before Thanksgiving this year and searched the net and could find no one else having the same problem I was having. 

Anyway, I just posted details to my fix in my blog if you want to see.  Pretty much the same as most others. 
http://www.cascologix.com/1/post/2012/12/first-experience-with-knockoff-products-part-1.html

Regarding the purpose of the resistors, they're basically just there for a buffer in case there is a problem with the display or someone accidentally hooks up incorrectly to the load side of the resistors.  guix got the ohm's law equation correct, but you have to look at the voltage drop across the resistor.  Since the load side of the resistors will be at 5V due to the display driver input pin being high-impedance and the display input pin voltage will follow the voltage of the Arduino output pin, the voltage across the resistor is virtually zero.  So the current will be much much less than 0.5mA.  The data input pin properties can be found in the display driver data sheet if you want to investigate further. 

The SD card interface is in fact only rated to 3.3V, so running this at 5V could damage your SD card.  The adapter board has unpopulated SMT resistor footprints so you can divide the voltage down from 5V on the Arduino to 3.3V on the TFT shield if needed.

Clint
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same hardware, and tried the wire jumping to get the SD to work.

It didn't work for me.

Before I would get "file not found" message, but now I get absolutely nothing.

What could I have done wrong?
Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Before too many folks go reaching for their soldering irons to fix 'badly built and untested hardware from Sainsmart', may I share my experiences with you...

I ordered a full Sainsmart setup ( Mega 2560, Adjustable TFT/Touch/SD, 3.2" TFT ) from ebay 23rd October from 'Sainsmart China'. It arrived Nov 1st which was pretty impressive to be honest, and all of this cost £30 to my door. The same setup from 'Sainsmart UK' was £45.

I made the initial oversight of forgetting to order an SD card to go with my new toys.

I am an electronics engineer by trade, but have no experience at all of Arduino hardware or how to program it, although I have previously played with PICs, and have limited/medium experience with C. Basically everything is a learning curve and new to me, that was the basis of my experience so far.


'In for a penny, in for a pound', I searched google, arduino display jpegs. It didnt take long to find henningkarlson. Got the wonderful utft, tinyfat, utft-tinyfat libries and bobs your uncle.

I had borrowed a Transcend 1GB SD card.........copied the test images to it and tried the utft-tinyfat "Demo Landscape" example........ no joy. MUCH reading later........ changed the pin definitions to match the Mega, lo and behold it worked...... I was dead chuffed. So I ordered a 8GB SDHC card again from China.

All I had read told me 4GB was the maximum although untested that tinyfat can handle, so partitioned and formatted 4GB to Fat16 and copied the images once again. My previously working sketch refused to work. Re-partitioned to 2GB still no luck, 1GB, no luck.....I was getting annoyed but took out my trusty multimeter and tested the signal paths as prescribed earlier in this thread. I can categorically state that my V1.0 mega shield pin outs are correct.....


53 - 38 CS
51 - 37 MOSI
52 - 36 SCK
50 - 35 MISO

Maybe we can deduce from this there is multiple 'V1.0' hardwares?

But the point is if I had not already seen it working with my own eyes, maybe I would have been reaching for the soldering iron myself!!

There is more to this than meets the eye!!

So I started populating the sketch with loads of 'Serial.println(xx)' .....This revealed almost nothing....No error codes!!! BUT the SD library 'Cardinfo' example listed the files perfectly......

I started combining SD and tinyfat..... Suddenly it worked......I have no satisfactory explanation for this and no happy ending.....I intend getting in touch with henning to persue this further...... But the code I have that works is shown :-


Quote
#include <tinyFAT.h>
#include <UTFT.h>
#include <UTFT_tinyFAT.h>
#include <SD.h>
File root;
// change this to match your SD shield or module;
//     Arduino Ethernet shield: pin 4
//     Adafruit SD shields and modules: pin 10
//     Sparkfun SD shield: pin 8
const int chipSelect = 53;

// Declare which fonts we will be using
extern uint8_t SmallFont[];

UTFTtf myGLCD(ITDB32S, 38, 39, 40, 41);   // Remember to change the model parameter to suit your display module!

int picsize_x, picsize_y;
boolean display_rendertime=false;  // Set this to true if you want the rendertime to be displayed after a picture is loaded
boolean display_filename=false;  // Set this to false to disable showing of filename

word res;
long sm, em;

void setup()
{
  myGLCD.InitLCD();
  myGLCD.clrScr();

//  pinMode(SS, OUTPUT);
  if (!SD.begin(chipSelect)) {
    return;
  }
  res=file.initFAT();
  myGLCD.setColor(255,255,255);
  myGLCD.setFont(SmallFont);
  picsize_x=myGLCD.getDisplayXSize();
  picsize_y=myGLCD.getDisplayYSize();
  res=myGLCD.loadBitmap(0, 0, 320, 240, "splash.raw");
  delay(5000);
  myGLCD.clrScr();

}

void loop()
{
  
 

}



BUT.......If you remove these lines.......

Quote
#include <SD.h>
File root;
// change this to match your SD shield or module;
//     Arduino Ethernet shield: pin 4
//     Adafruit SD shields and modules: pin 10
//     Sparkfun SD shield: pin 8
const int chipSelect = 53;

  if (!SD.begin(chipSelect)) {
    return;
  }


The sketch refuses to work?????  

I didnt have any of this trouble with the 1GB Transcend SD card, if anybody has any explanations I would love to hear them!!

Sorry this is long winded but I wanted to give as much information as possible.

Regards,

Graham.
« Last Edit: January 24, 2013, 05:29:19 pm by ghlawrence2000 » Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 336
Posts: 36467
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
BUT.......If you remove these lines.......
The sketch refuses to work?????  
So, if you don't call SD.begin(), you can't then read from the SD card. And, that surprises you?
« Last Edit: January 24, 2013, 07:23:19 pm by PaulS » Logged

Pages: [1] 2 3   Go Up
Print
 
Jump to: