ghostwubble
Member
I am about to get my first Teensy 3.1 to use in my project, I need to connect the Sainsmart 1.8" TFT display, I was wondering how I would do this. The display uses SPI and I need to connect SCL, SDA, RS/DC, RES, and CS pins.
// This Teensy3 native optimized version requires specific pins
//
#define sclk 13 // SCLK can also use pin 14
#define mosi 11 // MOSI can also use pin 7
#define cs 10 // CS & DC can use pins 2, 6, 9, 10, 15, 20, 21, 22, 23
#define dc 9 // but certain pairs must NOT be used: 2+10, 6+9, 20+23, 21+22
#define rst 8 // RST can use any pin
#define sdcs 4 // CS for SD card, can use any pin
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
// For optimized ILI9341_t3 library
#define TFT_DC 20
#define TFT_CS 21
#define TFT_RST 255 // 255 = unused, connect to 3.3V
#define TFT_MOSI 7
#define TFT_SCLK 14
#define TFT_MISO 12
#define sclk 13 // SCLK can also use pin 14 [COLOR="#0000FF"]-- SCL[/COLOR]
#define mosi 11 // MOSI can also use pin 7 [COLOR="#0000FF"]-- SDA[/COLOR]
#define cs 10 // CS & DC can use pins 2, 6, 9, 10, 15, 20, 21, 22, 23
#define dc 9 // but certain pairs must NOT be used: 2+10, 6+9, 20+23, 21+22
#define rst 8 // RST can use any pin [COLOR="#0000FF"]-- RES[/COLOR]
#define sdcs 4 // CS for SD card, can use any pin
EDIT#1: I really must 'preview' (/go advanced) before posting, can't claim I was ninja'd so much if timestamps on our posts are so far apart :embarrassed:
Edit#2: Soz defrag but BING is not anybody's friend, goog may be as evil as MS any day but inept and meaningless they manage not to be.
Signal Definition:
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
RESET : LCD controller reset, active low
CS (SD-CS) : Chipselect for TF Card,
CLK (SD-Clock): SPI Clock
MOSI (SD-DI) : SPI Master out Slave in
MISO (SD-DO) : SPI Master in Slave out
Looks like they are terming 'SDA' for the display interface and 'MISO/MOSI' for SD card interface.
(@defragster: Near its beginnings BING was simply useless - just checked and they have much more relevant (seeming) results for a couple of terms I tried but they used more bytes (with no perceivable benefit) to bring it to me and the format looks awful familiar...)