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

Thread: 2.4 inch ili9341 display w/ Teensy 4.1 behaving strangely...

  1. #1
    Junior Member
    Join Date
    Aug 2021
    Posts
    3

    2.4 inch ili9341 display w/ Teensy 4.1 behaving strangely...

    Hi,

    I don't have any code to post as I've just been testing my 2.4 inch ili9341 display with the optimized library's demo example. I wired it up to my 4.1 using the standard spi, kept DC and CS pins the same.

    However, I get this weird behaviour where the colour red displays as blue, and blue as red. And there seems to be weird tearing where the demo animations don't start in the corner, despite origins set to 0,0. When it fills the screen with a solid it only fills 2/3 of the 320pixels. As it rotates, it eventually fills the rest in, but not without leaving ghost pixels active in the previous rotation; it never actually fully clears the previous screen.

    Basically what I think is happening is that it is drawing 320pixels of information on the 240pixel axis. But, when I switched width and height in the library, nothing changed.

    So I tried the Adafruit library. Same issues.

    I think I have a wonky display.

    My ask to everyone here, the 2.4inch 320x240 ili9341 should work just like a 2.8inch 320x240 ili9341 right? No special configuration required in any of these libraries? I just got a lemon right?

  2. #2
    I'll test this setup tomorrow.

  3. #3
    Senior Member
    Join Date
    Apr 2019
    Posts
    158
    It's often the case that the displays they fit to the PCB have differences between them that aren't apparent when you buy them. There are IPS 160x80 SPI displays I use that have colours swapped and different 0,0 origins depending on who you buy from. They all look identical though. You probably haven't bought a lemon.

  4. #4
    Senior Member
    Join Date
    Apr 2019
    Posts
    158
    I bought one of these a while ago and it works fine except I need to set
    Code:
    tft.invertDisplay(true);
    but the display used on the PCB looks the same as yours. Can you post a photo of how it looks with a static image on it and someone might be able to offer a fix.

  5. #5
    Are you using the SD card reader on the back of the display? Is there anything connected to the SD SPI pins?

    My tests results

    Display Results
    2.8 #1 Works fine (Display & SD & touch)
    2.8 #1 Works fine (Display & SD, but display has no touch)
    2.4 #1 Works fine (Display & SD, but display has no touch)
    2.4 #2 Works fine (Display & SD, but display has no touch)
    2.2 #1 Works fine (Display but SD pins not connected)
    2.2 #2 Works fine (Display but SD pins not connected)

    This should not matter but maybe slow the displays SPI bus way down?
    tft.setClock(20000000);

    Also do you have RESET connected to 3v3 or a pin? I have mine connected to a pin

  6. #6
    Junior Member
    Join Date
    Aug 2021
    Posts
    3
    Thanks for testing all those sizes Kris. I'm designing a bigger project and really want to use the 2.4" screen, so this is very helpful in building my confidence that if I include one, I can find one that works.

    I am not using the SD connections at all. And had RESET floating at first, but then tied it to 3.3v, but nothing changed.

    I'll try lowering the clock. UHF, I'll tft.invertDisplay(true); as well.

    I'm away from my boards for a few days. Will report back if anything changes.

    Again, really appreciate you testing all those displays Kris. Helped my part selection immensely!

  7. #7
    Junior Member
    Join Date
    Aug 2021
    Posts
    3
    So none of the above worked unfortunately. Here's a photo of what's been happening.

    I think I just need to order another one.

    Click image for larger version. 

Name:	ili9341.jpg 
Views:	17 
Size:	93.5 KB 
ID:	25630

  8. #8
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,564
    Which library are you using... Optimized maybe ili9341_t3? or ..._t3n?

    And sometimes with these ones like aliexpress I wonder if they always use the same electronics... Some ones I see up on places say a display has one of and list three different chips...
    And they typically mention 240x320...

    Also would recommend slowing down the SPI buss, especially over jumper wires like that

  9. #9
    that really looks like the lib (or something) is flipping the height and width. Good question from the mighty KurtE...what lib are you using? I wonder if you reversed the height and width in the .h if it would 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
  •