Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 3.5 spi and Adafruit HX83573.5" TFT display

  1. #1
    Junior Member
    Join Date
    Jan 2019
    Posts
    10

    Teensy 3.5 spi and Adafruit HX83573.5" TFT display

    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

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,539
    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).

  3. #3
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,299
    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.

  4. #4
    Junior Member
    Join Date
    Jan 2019
    Posts
    10
    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.

  5. #5
    Junior Member
    Join Date
    Jan 2019
    Posts
    10
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •