Go Down

Topic: sainsmart.com ST7735 LCD (Read 3677 times) previous topic - next topic

StanO8

Nov 13, 2013, 09:02 pm Last Edit: Nov 13, 2013, 09:07 pm by StanO8 Reason: 1
Hello,
The sainsmart.com ST7735 LCD, product link:
http://www.amazon.com/gp/product/B008HWTVQ2/ref=oh_details_o06_s01_i01?ie=UTF8&psc=1

has the following pins:
GND : Power Ground
VCC : 5V power input
CS : Chipselect for LCD,
SDA : LCD Data for SPI
SCL : SCLK for TFT Clock
RS/DC : Command/Data Selection
RES : LCD controller reset, active low
CS (SD-CS) : Chipselect for TF Card,
SCLK (SD-Clock): SPI Clock
MOSI (SD-DI) : SPI Master out Slave in
MISO (SD-DO) : SPI Master in Slave out

I'm trying to get it to work on an Arduino Due. Not sure if it is currently possible because of drivers. If you were able to get this combination to work can you post the Arduino Due pins and a link to the drivers you used?

TIA!
Stan.

jemenake


Hello,
The sainsmart.com ST7735 LCD, product link:
http://www.amazon.com/gp/product/B008HWTVQ2/ref=oh_details_o06_s01_i01?ie=UTF8&psc=1

has the following pins:
GND : Power Ground
VCC : 5V power input
CS : Chipselect for LCD,
SDA : LCD Data for SPI
SCL : SCLK for TFT Clock
RS/DC : Command/Data Selection
RES : LCD controller reset, active low
CS (SD-CS) : Chipselect for TF Card,
SCLK (SD-Clock): SPI Clock
MOSI (SD-DI) : SPI Master out Slave in
MISO (SD-DO) : SPI Master in Slave out

I'm trying to get it to work on an Arduino Due. Not sure if it is currently possible because of drivers. If you were able to get this combination to work can you post the Arduino Due pins and a link to the drivers you used?


Greetings, Stan! I just got mine working. It seems that the Sainsmart labels their pins a little differently from the Adafruit. I was stumped, until I came across Kamal Mostafa's website (http://www.whence.com/rpi/). There, he presents a table of which pins on the Adafruit correspond to which pins on the Sainsmart. Specifically:











Adafruit____SainSmart
LITE
SCKSCL
MOSISDA
TFT_CSCS
D/CRS/DC
RESETRES
VCCVCC
GndGND


Ignore, completely, the 4 pins over in the SD-Card section. Some of those pins have the same labels as what is referred to in the TFT docs you'll find, but these are not the pins you want (unless you want to be accessing the SD card and not the TFT display).

The trouble seems to come from the fact that the Sainsmart labels their MOSI and Clock lines the way they're labeled with i2C (as "SCL" and "SDA"). Anyway, here's how I wired mine:










Arduino____SainSmart
13SCL
11SDA
10CS
9RS/DC
8RES
Aref or 5VVCC
GndGND


Although older examples let you assign all 5 of these pins however you want, the current examples in the Arduino software just specify CS, RS, and RES, while the SCL and SDA lines are just assumed to be plugged into your high-speed SPI lines. On my Uno, those are digital pins 13 and 11. On a Due, they're supposedly on pins "3" and "4", respectively, of the little 6-pin ICSP header.

Don't use the TFT18.ZIP that Sainsmart has on their website. It only works with an older version of the Arduino software. Instead, just use the built-in examples you'll find at File->Examples->TFT->Arduino

With the above wiring, I was able to run the built-in examples without any modification. I'm currently working on getting Sainsmart's demo sketches (like graphicstest_highspeed) to work. If you want them, let me know, but the built-in Arduino ones should work just fine for you.

StanO8

jemenake, thank you!

I just went into my stash of parts and pulled out the LCD. This evening I will try it with your information and report back.

Thanks again,
Stan.

StanO8

Okay, that worked for me!

Specifically:

Arduino Due pin :: SainSmart pin

5V :: VCC
GND :: GND
SCK (unmarked on 6 pin SPI header by erase button) :: SCL
MOSI (unmarked on 6 pin SPI header by erase button) :: SDA (NOTE: My silkscreen has SDA offset a little bit)

Arduino Due SCK & MOSI pins on the SPI header pictured here:
http://forum.arduino.cc/index.php?PHPSESSID=rl0s72mhhs1d74tb5q21np7nf2&topic=132130.0

Defined in the TFT Example sketch  (and can be changed):

8 :: RES (Sketch: rst)
9 :: RS/DC (Sketch: dc)
10 :: CS (Sketch: cs)

jemenake, once again, thank you!

Regards, Stan.

jemenake

Glad it worked out for you. Like I said, I just got mine going and I'm really geeking out with it... making my own 6x6 micro font so that I can use it as a tiny text display...

Drywa

Hello
I bought  from China 1.8" SPI LCD Module and would like to run it on Arduino Due Board.                                                                                                    I have IDE software version 1.5.5 . I need  for Due libraries files: St7735.h, GFX.h, SPI.h, SD.h.

armandohg

Wow! You guys are amazing!

I tried connecting my 1.8" TFT screen to the Due for a while but wasn't able until now.

Drywa, if you have the same TFT as mine these are the connections you need:
TFT -> DUE
GND -> GND
VCC -> 5v
nc -> none
nc -> none
nc -> none
Reset -> D8
A0 -> D9
SDA -> SPI MOSI
SCK -> SPI SCK
CS -> D10
SCK (SD) -> none
MISO (SD) -> none
MOSI (SD) -> none
CS -> none
LED+ -> 5v
LED- -> GND

This is how I got it working!

Now.. I have a question, has someone managed to connect the TFT and an Ethernet shield at the same time?

Keoni_

The TFT works fine without SD card,, but how can i use the display with SD card? i mean,, into SD.h use:

The circuit:
  * SD card attached to SPI bus as follows:
** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
** CS - depends on your SD card shield or module.
      Pin 4 used here for consistency with other Arduino examples



But pin 11 and 13 are used by TFT,


Any of you guys know how can read a bmp file into SD Card and draw it on TFT display?

Thanks a lot

jemenake


The TFT works fine without SD card,, but how can i use the display with SD card? i mean,, into SD.h use:

The circuit:
  * SD card attached to SPI bus as follows:
** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
** CS - depends on your SD card shield or module.
      Pin 4 used here for consistency with other Arduino examples

But pin 11 and 13 are used by TFT,

Any of you guys know how can read a bmp file into SD Card and draw it on TFT display?


I'm working on the same issue. Here's what I've learned about how SPI works: All of the "slaves" (which would be the TFT and the SD reader, in this case) share the same clock and data lines (CD, MOSI, and MISO). The "master" (the Arduino) selects which of them is supposed to be talking on those lines via separate "chip-select" (CS) lines.

This is why pins 11 and 13 being used by the TFT are not a problem. They can be shared by the TFT and the SD reader. So...

1) Connect your pin13-to-SCL line ("SCL" means "Serial CLock", by the way) also to the SCLK pin (which also means "Serial Clock").
2) Connect you pin11-to-SDA line ("SDA" means "Serial DAta in") also to the MOSI (which means "Master's Out, Slave's In").
3) Although the TFT doesn't need to talk back to the Arduino, the SD reader *does*, so connect it's MISO ("Master's In, Slave's Out") to pin12.
4) Lastly, we need a line to use to "select" the SD. Pin10 is used to select the TFT, if you wire yours up like I described above. The TFTBitmapLogo example in the Arduino kit defaults to using pin4 for the SD chip-select, so connect the CS pin in the "SD-CARD" section to Pin4.

Now, go download a 128x160 image... either the parrot.jpg or the logo.bmp at the example (http://arduino.cc/en/Tutorial/TFTBitmapLogo) and put it on a card and insert the card and run the bitmap logo example.

I've done all of this, but I'm getting "Initializing SD card... failed!". But it might be due to the type of card I have. Yours might work.

StanO8

Okay. I now have both sides, the screen and the SD card reader, working on the Arduino Due.

I put this bitmap onto the SD card:
http://arduino.cc/en/uploads/Tutorial/logo.bmp

I then used this sketch:
/home/stan/arduino-1.5.4/libraries/TFT/examples/Arduino/TFTBitmapLogo/TFTBitmapLogo.ino

In the sketch:
#define sd_cs  11
#define lcd_cs 10
#define dc     9
#define rst    8

Arduino Due pin :: SainSmart pin

5V :: VCC
GND :: GND
SCK (unmarked on 6 pin SPI header by erase button) :: SCL
MOSI (unmarked on 6 pin SPI header by erase button) :: SDA (NOTE: My silkscreen has SDA offset a little bit)
9 :: RS/DC (Sketch: dc)
8 :: RES (Sketch: rst)
10 :: CS (Sketch: lcd_cs)
MISO (unmarked on 6 pin SPI header by erase button) :: MISO
SCK (unmarked on 6 pin SPI header by erase button) :: SCLK
MOSI (unmarked on 6 pin SPI header by erase button) :: MOSI
11 :: CS (Sketch:sd_cs)

Regards,
Stan.

Go Up