Using Teensy 3.2 with 2 TFT Screen

Status
Not open for further replies.

antiwong

New member
hi,
I am using a Teensy 3.2 with 2x 2.2" 18-bit color TFT LCD display with microSD card breakout. each of the TFT LCD display has 6 pins - 3x for SD card and another 3x for SPI. tried to run the 2 displays with one teensy but we can't get the teensy to work on the second one. We can only read and display on one of the TFT LCD and not the other.

Any clues?
 
Some links to the displays you are using and a photo or schematic would be really useful to anybody trying to help you.

In the absence of information going to ask:
Have you confirmed both displays work in isolation
If you wire them in parallel (all the same pins) do they work
If you find the SPI pins and put them in on seperate pins can you boot and run demo on one, then without doing any wire changes and just changing the chip select line in your code get the other to display (first should show last image)
Once all that is done proving hardware you should be able to declare two TFT objects in your code with different chip selects and be done with it.
 
This is a TFT screen we purchased from Adafruit and we wired it up the following way.

3 DO LCD_RIGHT TFT-CS
4 DO LCD_RIGHT TFT-DC
5 DO LCD_RIGHT SD-CCS
6 DO LCD_RIGHT RST
7 DO LCD_LEFT SD-CCS
8 DO LCD_LEFT RST
9 DO LCD_LEFT TFT-DC
10 DO LCD_LEFT TFT-CS
11 SPI-MOSI LCD_RIGHT,LCD_LEFT MOSI
12 SPI-MISO LCD_RIGHT,LCD_LEFT MISO
13 SPI-SCK LCD_RIGHT,LCD_LEFT SCK

Here's the pin connection. We assign 1 pin to each SD interface but we share the SPI interface on both TFT screens. we are trying to get the 2 tft screens to display images from the SD card. we are having issues reading from one of the SD cards when we wiring up as above. One of the SD cards work but not the other.
Both screens work in isolation. We have connected 1 teensy to each screen and use Serial3 to communicate between teensies. This currently works but we want to remove one of the teensy in the future. would there be a conflict on the SD card pin out?
 
If that pinout list is the Teensy pins then you have most things right. Depending on what model display you have most likely offender is the SD card and display controller not playing well.

With the pins the DC is for the screen, so they can be shared if you update the program to reflect that, so you have data in, data out, serial clock and DC shared between the two PCBs to two TFTs and two SD slots. The only things that have to be unique are the chip selects. Reset can be shared as well, and depending on model can just be tied high.

Depending on the library you may need to use hardware chip selects, which are in light grey on the reference card 21,20,1,9 and 10. For maximum chance of just working suggest running DC and all four chip selects to those pins.
 
Checking the library suspecting that the displays are not fully closing out the pins when they finish a transaction. Once you have confirmed the wiring suggest doing a check of all four devices using the basic test code, and then activate them in pairs, making sure you have a delay(1) between accessing the various devices to make sure the pins settle before starting on the next device. Unsure if the problem is the hardware sending data to the wrong device, or if the code isn't liking having two copies of itself active.
 
Hard to say what is going on. Also especially since not everything is specified here. I assume that this display: https://www.adafruit.com/product/1480

So it is an ILI9340 based display, which maybe implies you are using the Adafruit library for this?

What library are you using read the SDCards with? I am wondering if that library (or libraries) is not setup to handle multiple instances (i.e. it has some global variables).
 
Hard to say what is going on. Also especially since not everything is specified here. I assume that this display: https://www.adafruit.com/product/1480

So it is an ILI9340 based display, which maybe implies you are using the Adafruit library for this?

What library are you using read the SDCards with? I am wondering if that library (or libraries) is not setup to handle multiple instances (i.e. it has some global variables).

Yes we are using that display and using the adafruit library to run the screen and SD card. I will have a look at the library and see if i can find out about the mulitiple instance. We are also trying the teensy 3.6 with 2 display. might be better but concerned about the fps.

Thanks!!
Anthony
 
Checking the library suspecting that the displays are not fully closing out the pins when they finish a transaction. Once you have confirmed the wiring suggest doing a check of all four devices using the basic test code, and then activate them in pairs, making sure you have a delay(1) between accessing the various devices to make sure the pins settle before starting on the next device. Unsure if the problem is the hardware sending data to the wrong device, or if the code isn't liking having two copies of itself active.

Thanks!! we will check if the delays help. That should help us to nail down the issues with CS.
 
Status
Not open for further replies.
Back
Top