Teensy 3.5 spi and Adafruit HX83573.5" TFT display

Status
Not open for further replies.

jwteensy

Member
Code below copied from the Adafruit graphics sketch for the HX8357 3.5" tft display.



#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_HX8357.h"



// These are 'flexible' lines that can be changed
#define TFT_CS 15
#define TFT_DC 34 //(uno 9)
#define TFT_RST 33 // (uno 8) RST can be set to -1 if you tie it to Arduino's reset

//#define TFT_MOSI 11
//#define TFT_SCK 13
//#define TFT_MISO 12
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC);


Hi there,
I cannot get the display to work with my teensy 3.5. If I use the display with an Arduino Uno it works perfectly but the cs, dc and rst port pins are 8,9 and 10.

I am using the dc, cs and rst control lines with the above port pin numbers, that is RST 33, dc 34 and cs 15. On the teensy 3.5 pinout diagram the SPI port 0 is listed as
11 - MOSI, 13 sck and MISO as 12.

Can anybody help.
Thanks in advance
John
 
To help you, we're going to need a little more info.

First, is this the Adafruit product you're using? It's the first one google returned when I searched with your description. But apparently this display's libraries work with others.

https://www.adafruit.com/product/2050

Is this the library you're using?

https://github.com/adafruit/Adafruit_HX8357_Library

Usually Adafruit's libraries work on Teensy. Often they're slow (on Teensy and all other boards) but they almost always do work.

Most often when things don't work, it's due to a mistake or misunderstanding in how to connect the wires, or using the wrong display (almost never an issue with genuine Adafruit products, but happens all the time when substituting cheap ones from Ebay & Aliexpress). Time and time again, we've helped solve these wiring problems, but we almost always need to see photos of how you've connected the hardware. Please, don't be shy, take some photos and post them here.

There's also a very slim chance something has gone on the software side. Before we explore that possibility, let's look at the actual connections (photos).
 
Debugging SPI (and I2C and I2S and UART) issues can be very frustrating. In such cases, a 4 or 8 channel logic analyser can, together with software protocol decoding, be very helpful to make sure that the right signals go onto the right pins. Chinese SALEAE clones can be found on eBay and amazon from 10$, the software for Win and macOS is free, thus costs shouldn't be an issue when it comes to efficient debugging all kinds of serial protocols.
 
HI there,
thanks for the replies.
I am using an Adafruit display product 2050. When I take the display and connect it to the SPI port on an Uno, works 100% with software as is|.
That is after I had the trouble trying to get the sketch to work with the Teensy I disconnected the display, connected it to the Uno Wifi and compiled the sketch.
Worked straight away.
I can also confirm that I am using the Adafruit library HX8357. I have made no changes to the library.
I will take photos and submit here. I have checked the pin outs against my board and the display several times in case I made a mistake.
 
Hello all,
have managed to fix the problem by using software spi on Teensy3.5 i/o pins 11,12,13 and 15. Hardware still will not work.
 
I purchased this display from Adafruit. Looks like their library requires the latest Adafruit_GFX lib. I deleted the one Teensyduino installed in Ardiuno's hardware/teensy/avr/libraries folder, and copied the latest GFX.

DSC_0385_web.jpg

It works fine with the latest libs. I wired the signals to Teensy 3.5's pins 8-13 exactly as Adafruit recommends. Here's a photo of the wires on the bottom side.

DSC_0387_web.jpg

Hopefully you can follow the wires and compare with the bottom side of the Teensy 3.5 pinout card to see how this is connected.
 
Status
Not open for further replies.
Back
Top