Hi!
I have just got an 2'' 240x320 TFT display(EA TFT020-23AINN) working on a Teensy 3.5 using the T3/4 optimised library.
My goal is to be able to drive 5 of these ST7789 displays from the same Teensy 3.5 on the same SPI bus. Because the remaining pins are already used for other purposes, I have to limit myself to an SPI bus.
At the moment I have the test programme below. A very simple program that controls 2 LCDs and outputs 3 lines in the loop, not optimised, a proof of cancept. I have several CS pins, the same DC and RST pin.
It compiles in the Arduino 2.0.3 IDE and runs also on the Teensy. But only one LCD works, the LCD that was last tftX.init(), therefore tft2.
The signals on my osciloscope look fine. The CS pins goes LOW one after the other and the MOSI also sends signals in this time. So one LCD gets the Data but dont give it out.
I'm new to this but my current thinking is that my options might be:
1) The SCK highestpoint is 2V. Maybe to low? But One LCD works so idk.
2) The library does not support multiple LCDs on one SPI bus.
3) One of the LCDs is initialised incorrectly and cannot read the data that comes in.
Does anyone have any thoughts on whether one of these strategies might work, or reasons why one or more can be ruled out, or perhaps another even better option? I am aware there are going to be speed considerations with sharing SPI busses for two devices. The displays will generally just be holding static texts for a while, not constantly updating, so I'm not too concerned. The processor will be doing almost nothing else.
This forum post describes a similar problem but I can't figure out what the answers are.
Thanks in advance for your thoughts!
-Jonas
I have just got an 2'' 240x320 TFT display(EA TFT020-23AINN) working on a Teensy 3.5 using the T3/4 optimised library.
My goal is to be able to drive 5 of these ST7789 displays from the same Teensy 3.5 on the same SPI bus. Because the remaining pins are already used for other purposes, I have to limit myself to an SPI bus.
At the moment I have the test programme below. A very simple program that controls 2 LCDs and outputs 3 lines in the loop, not optimised, a proof of cancept. I have several CS pins, the same DC and RST pin.
It compiles in the Arduino 2.0.3 IDE and runs also on the Teensy. But only one LCD works, the LCD that was last tftX.init(), therefore tft2.
The signals on my osciloscope look fine. The CS pins goes LOW one after the other and the MOSI also sends signals in this time. So one LCD gets the Data but dont give it out.
I'm new to this but my current thinking is that my options might be:
1) The SCK highestpoint is 2V. Maybe to low? But One LCD works so idk.
2) The library does not support multiple LCDs on one SPI bus.
3) One of the LCDs is initialised incorrectly and cannot read the data that comes in.
Does anyone have any thoughts on whether one of these strategies might work, or reasons why one or more can be ruled out, or perhaps another even better option? I am aware there are going to be speed considerations with sharing SPI busses for two devices. The displays will generally just be holding static texts for a while, not constantly updating, so I'm not too concerned. The processor will be doing almost nothing else.
This forum post describes a similar problem but I can't figure out what the answers are.
Thanks in advance for your thoughts!
-Jonas
Code:
#include <ST7735_t3.h> // Hardware-specific library
#include <ST7789_t3.h> // Hardware-specific library
#include <SPI.h>
#define TFT_CS1 2
#define TFT_CS2 3
#define TFT_RST 10
#define TFT_DC 8
ST7789_t3 tft1 = ST7789_t3(TFT_CS1, TFT_DC, TFT_RST);
ST7789_t3 tft2 = ST7789_t3(TFT_CS2, TFT_DC, TFT_RST);
void setup() {
//init LCDs
tft1.init(240, 320); // Init ST7789 320x240
tft2.init(240, 320); // Init ST7789 320x240
tft1.fillScreen(ST77XX_BLACK);
tft2.fillScreen(ST77XX_BLACK);
}
void loop() {
tft1.setCursor(15, 30);
tft1.fillScreen(ST7735_BLACK);
tft1.println("I am tft1");
tft2.setCursor(15, 30);
tft2.fillScreen(ST7735_BLACK);
tft2.println("I am tft2");
delay(1000);
tft1.setCursor(30, 100);
tft1.println("01099");
tft2.setCursor(30, 100);
tft2.println("56432");
delay(1000);
tft2.setCursor(30, 200);
tft2.println("0987864");
tft1.setCursor(30, 200);
tft1.println("2828");
delay(1000);
}