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

Thread: tft glitches

  1. #1

    tft glitches

    Hi I'm looking more for confirmation than advice.

    I've recently been having difficulties with a tft touch displsy (not the pjrc one but identical - it costs way too much to ship pjrc ones to the uk).
    just recently the TFT display has been corrupted after a few minutes running, colours going wrong, bits missing, lines across the screen.
    I've been racking my brains for a few days trying to figure out why, then I think i figured it out.
    after having to reinstall arduino and teensyduino, I could not remember what setting I had been on previously so set Arduino to teensy 3.5 & optimisation fastest + pure code.
    I've just changed that to optimisation fast, and the display has been running fine for the last few hours with no glitches.

    Am I right in thinking it was the optimisation settings that caused the problem?
    or am i barking up the wrong tree?

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,680
    Depending on the display, it might also be the SPI bus speed. I've seen OLED displays that can't receive data fast enough when the Teensy 3.5/3.6 are running at full speed. Now, the small TFT displays I've used don't seem to have a problem, but perhaps the display you are using can't receive data fast enough, or perhaps it is because the TFT display has a larger screen which shows up the problem.

    If you look in the code (probably the library), there should be a constructor or call to SPISettings. The first argument is the SPI bus speed. You might want to use a lower value.

    It could also be your code (or the library code) uses code that has undefined behavior, and increased optimization means the compiler might optimize it a different way.

  3. #3
    just for reference, the TFT Display is identical to the Teensy TFT display. but I will look at the spi speed when i gewt the time.

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,680
    Quote Originally Posted by grahamguitarman View Post
    just for reference, the TFT Display is identical to the Teensy TFT display. but I will look at the spi speed when i gewt the time.
    Yes, but the maker may have used different, slower components that limits the speed of the display. For example, I noticed this with the SSD1351 OLED displays (128x128). The Adafruit OLED display can only be driven at a SPI bus speed of 8Mhz without glitching, while the Wavelan OLED display can be driven with a SPI bus speed to 11Mhz. Now, the SSD7735 TFT displays that I have can be driven at 24Mhz.

    Also check your wires, and make them as short as possible. You might also need to use shielded wire.

Posting Permissions

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