Are there any better LCD Types?

Hi all,
I am a bit confused about LCD types. I am reading that TN displays are the fastest while IPS provides better viewing angle.

Right now I am using one of these:
4.0 Inch 320X480 SPI TFT LCD Module ESP32 Display ST7796 TN Capacitive Touch LCD Screen for Arduino/Mega2560/C51/STM32//ESP32 . (AliExpress or Amazon).

It's a TN (the fastest?), but I had to finagle the code to minimize the flashing screen during refreshes. It's a NTP clock, so for instance, I only update the minutes at sec=00. I've had to add lots of code to fix some of these issues. I also bumped the SPI clk to 20MHz, which seemed to help a bit.

Are there any better displays in this size class? The need to clear a display before writing new text/info is a real pain. What LCD types are laptops using, and how in the world would I put real time video on this thing? Am I missing something?

Thanks,
Bob

Have you tested the display with example code from the library used? Does that flash?

There is no such need as far as I am aware. I think doing this will probably make the screen flash.

My suggestion to you is to read the forum guide in the sticky post at the top of most forum categories. This will tell you what you need to provide and how to correctly include it in your post so that the forum can help you.

While you do that, I will move your topic to a more appropriate forum category, since it has nothing to do with LEDs or multiplexing.

Thank you for moving my post to the correct group.

I am using the GFX library, and I have used some examples and extracted code from them. Let's say you want to display a number, and have that number count. If you do not clear the display before each new write, the numbers will just write one of top of the other. For the native font, you can include a background color with the font color. That will print the background around the font. If you use any other font, like a converted Arial, that background feature is not available.

Unless I've misunderstood other posts, I am not the only one who has commented on this behavior, so it seems this is normal operation. I would love for someone to come along and tell me I've doing it wrong and show me how to do it right!

Bob

Try using this library and look at /try this sample



The last sample is for 7796

Most people clear just the region that will change, but not the entire display. Another approach is to overwrite the previous characters with the background color, then write the new ones with foreground color.

I can't imagine a "flicker" problem when simply updating the time every second, so you must be doing several things incorrectly. Consider posting the code, using code tags.

J-

That is what I am doing. I paint with either a black rectangle, or a black font (blk rect is easier) in the area of interest before writing new data. As this is a clock, if I did the entire HH:MM:SS, the display will noticeably flash. You have to write black to most, if not all of the display, and then write the new values. I have done the best I can, and currently it is performing well, but it still flickers ever so slightly when updating areas.

I have seen other posts mentioning similar problems, so the issue here is not so much if I am doing it wrong, but are there alternative displays, and has anyone had success writing video to one of these?

Bob

I won't waste any more of your time, Bob. Good luck.

You might want to look into the use of sprites. Once you get over the initial learning curve they are really quite handy.

Don

An SPI display is never going to be "fast", compared to a laptop or desktop computer that has a special purpose high speed bus in between the CPU, memory, and display. Even at 20MHz, you're looking at about 0.125 second just to send as many bits as needed to update those 32048016 bits of display.

You might have better luck with a "smart" display (like "Nextion") that would minimize the communications to the CPU. But I'm not sure how fast they can actually update the display with their local intelligence (they're still not "PC class.")

I am still a newbie so forgive me if I am not answering your questions properly.
I have include these libraries:

#include <Adafruit_GFX.h>
#include "Adafruit_ST7796S.h"

Initialize the display:
Adafruit_ST7796S display(TFT_CS, TFT_DC,TFT_RST);

 // Initialize the display
  display.setSPISpeed(20000000);  // Set SPI speed to 20 MHz
  display.init(320, 480, 0,0 , ST7796S_RGB);

  display.setRotation(landscape_R);
  display.fillRect(0, 0, display.width(), display.height(), BKGD);
display.fillRect(370, 38, 120, 80, BKGD)/*SS box*/; // refreshes seond window every second.
       drawText(370, 110, &ARIALBD48pt7b, 1, 1, WHITE, GREEN, String(secondString).c_str());  //  Second string

In the last line above, the background color (green) does not work with imported fonts. It works only with the built in fonts.
I have tried some demos and they seemed to work alright, those were mostly graphics. I will try some provide here and see what happens.
Bob

westfw,
So you are basically saying that what I am experiencing with this SPI display is normal? I will look into that "Nexion" display if nothing else but education.

floresta,
I will check out those "sprites"!

Thanks,
Bob

Next time, post ALL your code. Just for giggles I will pull out one of my displays and try the demo. What processor are you using and which sample sketch is that in post 10?

Hi,
I think posting all my code is impractical. I have lots of commented out code, and being a newbie, I doubt someone could follow it.

To answer your question, I included my libraries and the initialization. I also included a sample text write. I think westfw nailed it. The SPI port is never going to be fast enough.

Maybe I don't have a problem in that I am doing something wrong, but maybe I am not utilizing the best techniques to write and update the display. Maybe I need use inverted font writes instead of "fillRect" to clear the old pixels.

I am using an ESP32 dev board.

Bob

Posting in code tags makes it easy to post and we can copy/paste it. If you choose not to, then I choose to move on to those following the rules.

Did I not use code tags? What I posted looked formatted to me. Do you want all the code or just one function that display the clock? Is this forum the wrong place for newbies? You are the second person that has given me the bird.

Bob

Actually, I am the third to ask you to adhere to the guidance provided in the pinned post 'How to get the most from the forum'
You did use code tags, and it's not about formatting, although we do expect you have used Tools/Auto Format before copying for the forum.
By using code tags, we can quickly scroll the entire page, as opposed to just the code. Formatting code as opposed to HTML is also an advantage. The code tag window can handle a lot of code, we do not want another case of a bug being in code not shown.
I have no idea why you say I am the second person who has given you the bird. I don't even know what that means. My response, as well as two others, is a prevalent response as documented in the aforementioned pinned post.
I suggest you carefully read ALL the responses and address each one professionally.
You have already lost the assistance of one very senior, experienced helper, which is poor issue management.

It's hard to say without seeing your code.
It's possible that something in your code, or the library you are using, is causing your pre-erase to be much slower than it ought to be (erasing pixel-by-pixel instead of making use of controller functions for erasing lines or rectangles, for instance.) Or you could be more careful about only erasing the areas that are due to change, rather than the whole "time" string.