Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 3 1 2 3 LastLast
Results 1 to 25 of 55

Thread: Adafruit 3.5" TFT HX8357D

  1. #1
    Junior Member
    Join Date
    Mar 2015
    Posts
    3

    Adafruit 3.5" TFT HX8357D

    G'day,

    I have the Adafruit 3.5" touchscreen TFT with HX8357D chip and want to get it working with the Teensy 3.1 in SPI mode.

    The Adafruit libraries (https://github.com/adafruit/Adafruit_HX8357_Library/) will not compile under TeensyDuino 1.20.

    "In file included from sep_35_TFT_graphicstest_2.ino:18:0:
    C:\Program Files (x86)\Arduino\libraries\Adafruit_HX8357/Adafruit_HX8357.h:163:14: error: 'RwReg' does not name a type"


    Can anyone help me on how to adapt the library to work with the Teensy 3.1.

    Thanks

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,064
    Please give this copy a try?

    https://github.com/PaulStoffregen/Ad...HX8357_Library

    Please let me know if this works. I don't have one of these particular displays for testing, so the best I can do is confirm it compiles. If you can confirm it works on a real display, I'll ask Adafruit to update their copy.

  3. #3
    Junior Member
    Join Date
    Mar 2015
    Posts
    3
    Thanks Paul for such a quick response. Unfortunately the new library didn't work - it just yielded a blank screen.

    However in trying everything to get something to work I tried the "Adafruit_ILI9341" library, and, having changed the TFT dimensions in the .h file, it works !

    Scanning through the HX8357 and ILI9341 .cpp and .h files I see a number of differences in how the TEENSYDUINO is handled, however it is a little beyond my experience to know which of these make the difference.

  4. #4
    Quote Originally Posted by vee two View Post
    Thanks Paul for such a quick response. Unfortunately the new library didn't work - it just yielded a blank screen.

    However in trying everything to get something to work I tried the "Adafruit_ILI9341" library, and, having changed the TFT dimensions in the .h file, it works !

    Scanning through the HX8357 and ILI9341 .cpp and .h files I see a number of differences in how the TEENSYDUINO is handled, however it is a little beyond my experience to know which of these make the difference.
    So Vee two did you end up getting this working with the Teensy 3.1 in SPI mode correctly?

  5. #5
    Junior Member
    Join Date
    Mar 2015
    Posts
    3
    G'day solardude,

    I ended up using the "Adafruit_ILI9341" library and just changed the TFT dimensions in the .h file. This works fine.

    I cannot say if it is the fastest or most efficient way to address this display, but it does work. My project is a bedside clock so refresh speed etc is not important as the screen is only updated every 10 sec or so. The clock has been running for a few months now and is much nicer than the old monochrome Graphic LCD display!

  6. #6
    Quote Originally Posted by vee two View Post
    G'day solardude,

    I ended up using the "Adafruit_ILI9341" library and just changed the TFT dimensions in the .h file. This works fine.

    I cannot say if it is the fastest or most efficient way to address this display, but it does work. My project is a bedside clock so refresh speed etc is not important as the screen is only updated every 10 sec or so. The clock has been running for a few months now and is much nicer than the old monochrome Graphic LCD display!
    Awesome.

    Thanks for the reply. I have the same LCD screen and may want to use it with the Teensy 3.1 so it's good to know there is a working library for it.

    I'm working with a different LCD on the Teensy 3.1 now, but the color LCD was my first choice but it consumes way more power than the Sharp Memory LCD screen I'm working with now which is important for my battery based application.

  7. #7
    Junior Member
    Join Date
    Jul 2015
    Posts
    6
    Hi, folks!

    I'm now struggling how to connect Adafruit 3.5" HX8357D to Teensy 3.1, so far without success. I used pin scheme as described here https://www.pjrc.com/store/display_ili9341.html and used optimized ILI9341 library. It seems that display responds but I don't see any picture on screen.

    Could anybody please share how did you manage to make it work?

    Cheers,
    Albert

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,064
    I don't see how the ILI9341 library could possibly work. This display has a different controller and more pixels.

    Your best bet is to go back to using the code on message #2. Maybe post a photo of the wiring, so we can see exactly how you connected it.

  9. #9
    Junior Member
    Join Date
    Jul 2015
    Posts
    6
    Dear Paul,

    I tried using code from message #2. The display also doesn't work. Furthermore, it's strange, but according to "\examples\graphicstest" Teensy should send messages via Serial, but it doesn't.

    I tried using ILI9341 library because vee two posted a message that he managed to do it.

    Double checked the wiring, there are no problems with wires. Currently, I'm using the following pin layout:
    D/C - pin #9
    CS - pin #10
    MOSI - pin #11
    MISO - pin #12
    CLK - pin #13

    I'm using Arduino 1.6.3 and Teensyduino 1.24.

    Cheers,
    Albert
    Last edited by albertkhan; 08-02-2015 at 01:58 PM.

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,064
    Quote Originally Posted by albertkhan View Post
    I tried using code from message #2. The display also doesn't work.
    Let's focus on figuring out why it isn't working!

    I tried using ILI9341 library because vee two posted a message that he managed to do it.
    I don't see how it could possibly work with this display! The controller and the screen res aren't the same.


    Double checked the wiring, there are no problems with wires. Currently, I'm using the following pin layout:
    D/C - pin #9
    CS - pin #10
    MOSI - pin #11
    MISO - pin #12
    CLK - pin #13
    Please don't take this the wrong way.... but I'd like to ask you to post a photo of your wiring. I know you've double checked it... but believe me, it's pretty common to have a simple wiring error that you'll see as correct every time. Posting photos will let us look it over and maybe see something you might have missed.

  11. #11
    Junior Member
    Join Date
    Jul 2015
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    Please don't take this the wrong way.... but I'd like to ask you to post a photo of your wiring. I know you've double checked it... but believe me, it's pretty common to have a simple wiring error that you'll see as correct every time. Posting photos will let us look it over and maybe see something you might have missed.
    The wiring on display is temporary, but I sucessfully controlled it from Arduino.
    No idea how photos will help you, vee two already posted that code doesn't work.

    Click image for larger version. 

Name:	20150802_210357.jpg 
Views:	724 
Size:	93.1 KB 
ID:	4818Click image for larger version. 

Name:	20150802_210727.jpg 
Views:	286 
Size:	40.4 KB 
ID:	4819
    Last edited by albertkhan; 08-02-2015 at 07:17 PM.

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,064
    Is that photo the wiring you actually tried using? There's no power connections!

  13. #13
    Junior Member
    Join Date
    Jul 2015
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    Is that photo the wiring you actually tried using? There's no power connections!
    Display is powered from the other side, the pins are symmetrical and identical. The Teensy is powered via USB.
    Both display and Teensy have the same GND.
    Last edited by albertkhan; 08-03-2015 at 01:15 PM.

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,064
    I believe the code in message #2 should work, and the cause of failure is very likely a wiring error.

    Posting these sorts of photos and description, which attempt to prove you've done things correctly rather than show what you've actually done, well, just isn't helping me to try to help you. Obviously the photos in message #11 aren't genuinely how you tested, because the USB cable isn't plugged in. How could Teensy possibly have a common ground with the display, as shown in that photo. Maybe there's more connections made to the display, since your photos don't show everything. Can you see how not showing everything, and taking staged photos that aren't how you actually had everything connected when actually running the code just aren't useful?

    I want to help you. I also want to permanently resolve any compatibility issue with this Adafruit library. But I just don't see how that can happen... unless I buy this Adafruit display and wire it up here, and post real photos to show you how to connect it. I very well may do that, as I've done it for plenty of other Adafruit products. But so far, this is the first and only request on this particular display, so I'm not sure if it really merits that time and money.

  15. #15
    Junior Member
    Join Date
    Jul 2015
    Posts
    6
    Could anybody help with connecting resistive touchscreen pins X- X+ Y- Y+ to Teensy 3.1? I tried to use Touchscreen library but it seems it won't work with Teensy(

  16. #16
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,064
    Are you using this library, or some other one with a similar name?

    https://github.com/adafruit/Touch-Screen-Library/

  17. #17
    Junior Member
    Join Date
    Jul 2015
    Posts
    6
    It's the same library I tried to use, it doesn't even compile for Teensy..

  18. #18
    Junior Member
    Join Date
    Sep 2015
    Posts
    3
    Greetings everyone,

    I have been trying to get the teensy 3.1 to work with the Adafruit 3.5" tft lcd touchscreen for the last few days. I have gone through all of the various examples trying to get it to work.

    I have it wired as follows:
    8 : rst
    9 : d/c
    10: cs
    11: mosi
    12: miso
    13: clk
    gnd: gnd
    3.3V: vin
    I attached the following picture to confirm
    Click image for larger version. 

Name:	20150905_144125.jpg 
Views:	487 
Size:	106.0 KB 
ID:	5043

    I have had pretty much the same experience as most of the people in this thread.

    When I tried the ILI9341_t3 library, it compiled and the serial monitor printed everything in the test, but the lcd sceen only showed blank white. According to PaulStoffregen, that is what should happen because the 3.5" adafruit screen uses the HX8357_Library.

    Next I downloaded the HX8357_Library that is linked to in the second post. https://github.com/PaulStoffregen/Ad...HX8357_Library. It compiled, but this time when it runs, nothing is printed in the serial monitor, and again the lcd screen is blank white.

    Is there any other tests I can try, or info I can give to try and get it working?

    Also, I have used the screen in 8-bit mode with a mega 2650, and it worked. My next step is to connect it to the mega 2650 through SPI to make sure the SPI works.

    UPDATE:

    I tried the SPI interface with the mega 2650, so I know that the screen's hardware is working.
    Next I am going to try the SPI interface on the teensy with a sensor or something besides the display to make sure that SPI is working on the teensy.
    Last edited by stevemkrenz; 09-05-2015 at 10:23 PM. Reason: New Information

  19. #19
    Senior Member
    Join Date
    Mar 2013
    Posts
    651
    Quote Originally Posted by stevemkrenz View Post
    Greetings everyone,

    I have been trying to get the teensy 3.1 to work with the Adafruit 3.5" tft lcd touchscreen for the last few days. I have gone through all of the various examples trying to get it to work.

    I have it wired as follows:
    8 : rst
    9 : d/c
    10: cs
    11: mosi
    12: miso
    13: clk
    gnd: gnd
    3.3V: vin
    I attached the following picture to confirm
    Click image for larger version. 

Name:	20150905_144125.jpg 
Views:	487 
Size:	106.0 KB 
ID:	5043

    I have had pretty much the same experience as most of the people in this thread.

    When I tried the ILI9341_t3 library, it compiled and the serial monitor printed everything in the test, but the lcd sceen only showed blank white. According to PaulStoffregen, that is what should happen because the 3.5" adafruit screen uses the HX8357_Library.

    Next I downloaded the HX8357_Library that is linked to in the second post. https://github.com/PaulStoffregen/Ad...HX8357_Library. It compiled, but this time when it runs, nothing is printed in the serial monitor, and again the lcd screen is blank white.

    Is there any other tests I can try, or info I can give to try and get it working?

    Also, I have used the screen in 8-bit mode with a mega 2650, and it worked. My next step is to connect it to the mega 2650 through SPI to make sure the SPI works.

    UPDATE:

    I tried the SPI interface with the mega 2650, so I know that the screen's hardware is working.
    Next I am going to try the SPI interface on the teensy with a sensor or something besides the display to make sure that SPI is working on the teensy.
    Going from your picture your powering the screen from the Teensy 3.3Vout correct? Well if so DONT. You could kill your Teensy. The backlights are power hungry, you could be browning out the screen because of the power draw from the backlight.

    Use the Vin connection, the Vin connects to the USB 5v and does not draw power from the Teensy itself. The screen supports 3-5V in.

  20. #20
    Junior Member
    Join Date
    Sep 2015
    Posts
    3
    Thanks so much, Donziboy2. I moved the vin pin on the screen to the vin on the teensy 3.1 and loaded up the ILI9341_t3 graphics test sketch and it worked instantly. I did notice my teensy was getting stupid hot after only 5-10 seconds of powering the screen through the 3.3v, which I guess makes sense from what you said.

    On a side note, I did change the res in the ILI9341_t3.h from whatever it was to
    #define ILI9341_TFTWIDTH 320
    #define ILI9341_TFTHEIGHT 480

  21. #21
    Junior Member
    Join Date
    Dec 2015
    Posts
    10
    Hi,
    I too have a Adafruit 480x320 HX8357D chip screen and a Teensy 3.2.
    I have it running in SPI mode using the Adafruit_ILI9341 library.
    I would like to see if I could get the 8bit mode running.
    Any sugestions?

    It works fine in SPI mode for the "graphicstest" but I can not get the "spitftbitmap" to work properly.
    I got heaps of errors with Arduino ver 1.6.6 so I used ver 1.6.5 and I got it to display to screen.
    But it was a repeating pattern and not the picture.

    So is the spi running too fast to read the SD card?
    Do I need a faster sd card? It is a fast card but not the fastest.

    Could somebody help please?

    Cheers
    Rod
    Last edited by Dreamfit_Rod; 12-09-2015 at 01:17 PM.

  22. #22
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,064
    Adafruit's library doesn't even support 8 bit mode.

    Maybe try UTFT?

  23. #23
    Junior Member
    Join Date
    Dec 2015
    Posts
    10
    Quote Originally Posted by PaulStoffregen View Post
    Adafruit's library doesn't even support 8 bit mode.

    Maybe try UTFT?
    Thanks Paul.
    I think SPI is fast enough for what I want at the moment.
    Unfortunately UTFT doesn't support the HX8357D chip.

    Do you know of any reason why the bitmap code doesn't display right?
    Could it be the speed of the SPI?

    Cheers
    Rodney

  24. #24
    Senior Member
    Join Date
    Nov 2012
    Posts
    273
    The TFTLCD-Library from Adafruit is for the 8-bit mode (https://github.com/adafruit/TFTLCD-Library).

  25. #25
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,064
    Is that not-very-optimized 8 bit library actually faster than optimized SPI?

Posting Permissions

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