Go Down

Topic: itdb02 sd card : unable to do working (Read 5 times) previous topic - next topic

vincent13

Sep 29, 2012, 04:22 pm Last Edit: Sep 29, 2012, 04:25 pm by vincent13 Reason: 1
Hello all,

That's my first post but before asking, I've lost many long hours to search.

I'am working with an arduino Mega with an itdb02 lcd and touch (buy on ebay chinese seller).
using 1.01 version of shield.

on the lcd board there is a sd card reader.

here are some picture of the lcd+sd card and tft lcd mega shield




I've checked allthe wiring here are my check results :

SS     - mega pin 53 - shield pin 38 - SD_CS - pin 1 SD
MOSI - mega pin 52 - shield pin 37 - SD_DIN - pin2 SD
SCK   - mega pin 51 - shield pin 36 - SD_SCK - pin5 SD
MISO - mega pin 50 - shield pin 35 - SD_OUT - pin 7 SD

with two resisor of 1k so 1.9 K on signal but not on MISO.


I have tested all the library available that I found : sdfat, tinyFat,sd sparkfun
but unsucessfully ...

for example using software SPI with sdfat modifying sdfatconfig.h

/**
* Set USE_SOFTWARE_SPI nonzero to always use software SPI.
*/
#define USE_SOFTWARE_SPI 1
// define software SPI pins so Mega can use unmodified 168/328 shields
/** Default Software SPI chip select pin */
uint8_t const SOFT_SPI_CS_PIN = 53;
/** Software SPI Master Out Slave In pin */
uint8_t const SOFT_SPI_MOSI_PIN = 52;
/** Software SPI Master In Slave Out pin */
uint8_t const SOFT_SPI_MISO_PIN = 50;
/** Software SPI Clock pin */
uint8_t const SOFT_SPI_SCK_PIN = 51;
#endif  // SdFatConfig_h

do not work.

my sd card is fat 16 formatted

what should I do ?



PaulS

Why are you using software SPI on the hardware SPI pins?

vincent13

because it seems that on mega the spi pin are different than  the wiring of these chinese shield.

chinese shield
SS     - mega pin 53
MOSI - mega pin 52
SCK   - mega pin 51
MISO - mega pin 50

mega
this is 50 (MISO), 51 (MOSI), 52 (SCK), and 53 (SS). MISO, MOSI

I suppose the chineses do an error between sck and mosi ?

beige

If it's anything like the sainsmart board that i've been getting to work properly, at the every least you'll need to swap SCK and I think MOSI.

I had another problem where CS looked rather like bart simpsons hair, so I put in a 74HC4050 and now it all works at full speed.

PaulS

Quote
because it seems that on mega the spi pin are different than  the wiring of these chinese shield.

The point is that the hardware SPI pins can not be used for software SPI, any more than the hardware serial pins can be used for software serial.

Go Up