Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2305
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #15 on: January 04, 2013, 10:50:48 pm » |
No the ST7735 driver is an SPI device only. The more expensive of the two form OP's post is identical to one from Adafruit to the SD card and footprint for the 8 pin eprom on the back side. the real difference is the $15.00 price difference.
Bob
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
South UK
Offline
Sr. Member
Karma: 1
Posts: 479
|
 |
« Reply #16 on: January 11, 2013, 08:30:56 pm » |
EDIT: Done some more searching (a lot more lol) and managed to work out the wiring, and also get the adafruit libs installed and now it is working, very impressive little screen!Hi all. The display has just arrived  I got one of these http://www.ebay.co.uk/itm/1-8-Serial-128X160-SPI-TFT-LCD-Module-Display-PCB-Adapter-SD-Socket-/261150773094I'm not sure how to wire it up though  Just looked at the adafruit tutorial and the board has different pin definitions? 
|
|
|
|
« Last Edit: January 11, 2013, 09:46:52 pm by dtokez »
|
Logged
|
|
|
|
|
South UK
Offline
Sr. Member
Karma: 1
Posts: 479
|
 |
« Reply #17 on: January 11, 2013, 10:41:20 pm » |
OK, first question has arisen already  I notice when you send data to the screen it stays until something is written over it. When sending variable data text strings to the TFT, the results just keep overlaying each other. Sending tft.fillScreen(ST7735_BLACK); is very slow and it seems pointless re-writing any static text also. Is there a simple way around it? I guess you could just write black squares over areas but that sounds like a nightmare to implement  Also the wrong as some of you mentioned would be the case.
|
|
|
|
|
Logged
|
|
|
|
|
Katowice POLAND
Offline
Full Member
Karma: 2
Posts: 127
Arduino rocks
|
 |
« Reply #18 on: January 12, 2013, 04:57:27 am » |
There is a method to speed up communication In Adafruit_ST7735.cpp search for SPI.setClockDivider(SPI_CLOCK_DIV4);
and change it to SPI.setClockDivider(SPI_CLOCK_DIV2);
That will speed up SPI bus
I was using it on 3.3v 8mhz atmega328p, not on 16mhz so it may not work
|
|
|
|
|
Logged
|
|
|
|
|
South UK
Offline
Sr. Member
Karma: 1
Posts: 479
|
 |
« Reply #19 on: January 12, 2013, 02:26:01 pm » |
Is that using the hardware SPI pins? I have just looked at the code and again and realised I am not using them? // You can use any (4 or) 5 pins #define sclk 4 #define mosi 5 #define cs 6 #define dc 7 #define rst 8 // you can also connect this to the Arduino reset
#include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7735.h> // Hardware-specific library #include <SPI.h>
// Option 1: use any pins but a little slower Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst);
// Option 2: must use the hardware SPI pins // (for UNO thats sclk = 13 and sid = 11) and pin 10 must be // an output. This is much faster - also required if you want // to use the microSD card (see the image drawing example) //Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);
|
|
|
|
|
Logged
|
|
|
|
|
Katowice POLAND
Offline
Full Member
Karma: 2
Posts: 127
Arduino rocks
|
 |
« Reply #20 on: January 12, 2013, 03:29:14 pm » |
my code is only for hardware spi (it is 2-4 times faster than software)
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2305
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #21 on: January 12, 2013, 03:44:32 pm » |
The answer to the overlaid printing is to first print a blank line over the text you are refreshing. Glcd.print(" "); or something similar. I'm not at home now so I can't share the example code. If you need it I'll be happy to post it later today.
Bob
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
South UK
Offline
Sr. Member
Karma: 1
Posts: 479
|
 |
« Reply #22 on: January 12, 2013, 08:55:19 pm » |
@zachwiej - How do you connect up the display to the hw SPI on the arduino? // Option 2: must use the hardware SPI pins // (for UNO thats sclk = 13 and sid = 11) and pin 10 must be // an output. This is much faster - also required if you want // to use the microSD card (see the image drawing example) I guess 13 goes to SCK on the lcd, but I'm not sure what pins 11 and 10 need to be wired to on the screen? @Docedison - Thanks Bob I would quite like to see the code if you don't mind.
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Sr. Member
Karma: 9
Posts: 351
|
 |
« Reply #23 on: January 13, 2013, 12:23:38 am » |
Pin 10 to cS (the one for TFt, not the one in the SD section) Pin 11 to SDA Pin 13 to SCL
If you want to use the SD card too then also wire the MOSI, MISO and SCK from SD card connections to 11,12,13 and the CS to 4.
|
|
|
|
|
Logged
|
|
|
|
|
Katowice POLAND
Offline
Full Member
Karma: 2
Posts: 127
Arduino rocks
|
 |
« Reply #24 on: January 13, 2013, 05:35:25 am » |
 LCD MISO goes to arduino MISO, MOSI to MOSI, SCK to SCK, CS to CS and there will be one signal left so connect it to any other pin. Like in Adafruit tutorial
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Sr. Member
Karma: 9
Posts: 351
|
 |
« Reply #25 on: January 13, 2013, 06:17:46 am » |
The TFT connections are labelled SDA, SCL, CS, AO. The SD card connections are labelled MOSI, MISO, SCK, CS.
At first glance it looks like the TFT is I2C (SDA and SCL) but these actually correspond to he TFT's MOSI and SCK inputs. AO is the DC in the Adafruit tutorial.
There are two CS, but one is clearly marked inside an area labelled 'SD' while the other (TFT) is outside that area.
|
|
|
|
« Last Edit: January 13, 2013, 06:20:21 am by tack »
|
Logged
|
|
|
|
|
South UK
Offline
Sr. Member
Karma: 1
Posts: 479
|
 |
« Reply #26 on: January 13, 2013, 07:29:46 pm » |
Hi all. I'm still confused here. I have now connected 3 data pins as such and it is not working Pin 10 to TFT CS Pin 11 to TFT SDA Pin 13 to TFT SCK Where do I connect A0 or reset? The adafruit tutorial says "sclk = 13 and sid = 11) and pin 10 must be an output". // You can use any (4 or) 5 pins #define sclk 1 #define mosi 5 #define cs 6 #define dc 7 #define rst 8 // you can also connect this to the Arduino reset
#include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7735.h> // Hardware-specific library #include <SPI.h> #include <math.h>
// Option 1: use any pins but a little slower //Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst);
// Option 2: must use the hardware SPI pins // (for UNO thats sclk = 13 and sid = 11) and pin 10 must be // an output. This is much faster - also required if you want // to use the microSD card (see the image drawing example) Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst); Will the above work or do I have to change the #define pins, or does something in the library set it up? Thanks!
|
|
|
|
« Last Edit: January 13, 2013, 07:34:55 pm by dtokez »
|
Logged
|
|
|
|
|
Katowice POLAND
Offline
Full Member
Karma: 2
Posts: 127
Arduino rocks
|
 |
« Reply #27 on: January 13, 2013, 07:34:59 pm » |
Hi If You want to use hardware SPI use this definition (You can change those pins) #define cs 10 #define dc 9 #define rst 8 Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);
|
|
|
|
|
Logged
|
|
|
|
|
South UK
Offline
Sr. Member
Karma: 1
Posts: 479
|
 |
« Reply #28 on: January 13, 2013, 08:07:28 pm » |
Thanks! it is working now, I didn't have A0 connected to pin 9  I am just working on trying to get test to refresh without blanking the entire screen. I'm trying out the following but the blank line does not appear to be printing and the variable is still getting overwritten constantly?
|
|
|
|
|
Logged
|
|
|
|
|
Katowice POLAND
Offline
Full Member
Karma: 2
Posts: 127
Arduino rocks
|
 |
« Reply #29 on: January 13, 2013, 08:18:38 pm » |
Just print the old text in white before printong new text  works like charm
|
|
|
|
|
Logged
|
|
|
|
|
|