0

3.5" TFT FeatherWing display mirrored?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

3.5" TFT FeatherWing display mirrored?

by Wumbologist on Tue Jan 01, 2019 5:21 am

Here's a demo of my issue with touchpaint: https://i.imgur.com/nQTem9T.gifv
Here's some text: https://i.imgur.com/K0z7T7Z.jpg

This is how my display's been ever since I've gotten it, no matter what I try to display to it. The direction is correct immediately after uploading, but as soon as I unplug the USB giving power and plug it back in, the display is now mirrored. I don't mean rotated, I mean mirrored. This is for everything, including text.

Any idea what's going on and how I can fix it? My display is product ID 3651 and the Feather is the 32u4 Basic Proto.

Wumbologist
 
Posts: 12
Joined: Fri Dec 28, 2018 1:41 am

Re: 3.5" TFT FeatherWing display mirrored?

by Wumbologist on Tue Jan 01, 2019 4:38 pm

So looking into this issue, it seems to be a common problem with displays powered by the ILI9481 controller which is only partially compatible with the HX8357. Is Adafruit sure that this display uses an HX8357 not the ILI9481? I've also seen this issue pop up a lot with people using the SD card slot, but I'm not interested in that and this issue is appearing with the example sketches.

I dug around into Adafruit_HX357.cpp and tried changing the values of line 58:

Code: Select all | TOGGLE FULL SIZE
#define MADCTL_MV  0x20     ///< Reverse Mode


Changing this value around got the display to no longer be mirrored, at the cost of some serious graphical glitches. Check it out:
https://i.imgur.com/9vdyfBk.jpg

Note that images are still reversed depending on whether this is immediately after flashing/uploading. Immediately after flashing the Feather, text appears reversed, but after unplugging/plugging back in the text appears in the proper direction.

Wumbologist
 
Posts: 12
Joined: Fri Dec 28, 2018 1:41 am

Re: 3.5" TFT FeatherWing display mirrored?

by Wumbologist on Wed Jan 02, 2019 10:42 am

So I can just click the reset button and when the Feather restarts the display will be outputting correctly. This means the best workaround I can think of is wiring up my Feather so I can programatically short the Reset pin, but the logic of how I'd do that gets tricky. I'd need to make the Feather restart as soon as it's plugged in, but if that's the first line of setup() then I'll be in an infinite reset loop. I'll need to keep a binary state of whether or not this is a manual restart or not, but to my knowledge the Feather has no EEPROM. Now, the best workaround for that problem that I can think of is using an SD card.

This seems like an awful lot of work just to make sure that this display outputs correctly.

It might be worth mentioning that when the display is reversed, the colors are also wrong. Check it out:
https://i.imgur.com/iw5wzlq.jpg
https://i.imgur.com/zl7go7F.jpg

Wumbologist
 
Posts: 12
Joined: Fri Dec 28, 2018 1:41 am

Re: 3.5" TFT FeatherWing display mirrored?

by adafruit_support_carter on Thu Jan 03, 2019 1:45 pm

This image appears correct:
https://imgur.com/iw5wzlq
You can compare to expected out here:
https://cdn-learn.adafruit.com/assets/a ... 6_ORIG.jpg

Are you running this example from the library?
https://github.com/adafruit/Adafruit_HX ... erwing.ino

Make sure all your libraries are up to date. There has been a lot of recent activity in the GFX library.

adafruit_support_carter
 
Posts: 11681
Joined: Tue Nov 29, 2016 2:45 pm

Re: 3.5" TFT FeatherWing display mirrored?

by Wumbologist on Fri Jan 04, 2019 7:24 am

adafruit_support_carter wrote:This image appears correct:
https://imgur.com/iw5wzlq
You can compare to expected out here:
https://cdn-learn.adafruit.com/assets/a ... 6_ORIG.jpg

Are you running this example from the library?
https://github.com/adafruit/Adafruit_HX ... erwing.ino

Make sure all your libraries are up to date. There has been a lot of recent activity in the GFX library.

That image was just a comparison of the colors from when it's correct vs when it's wrong, sorry for the confusion.

I've deleted and reinstalled my libraries multiple times, so I doubt that's the problem.

It seems like this is a hardware problem where the display is reversed if it doesn't power cycle properly. Has anyone else ever had this problem?

Wumbologist
 
Posts: 12
Joined: Fri Dec 28, 2018 1:41 am

Re: 3.5" TFT FeatherWing display mirrored?

by adafruit_support_carter on Fri Jan 04, 2019 12:28 pm

I've never seen it before, but with all the recent work in the libraries, maybe something is happening in the driver. To clarify, since you've done various testing - with the latest Arudino IDE and the latest versions of all the libraries, what happens if you run the example sketch:
https://github.com/adafruit/Adafruit_HX ... erwing.ino

adafruit_support_carter
 
Posts: 11681
Joined: Tue Nov 29, 2016 2:45 pm

Re: 3.5" TFT FeatherWing display mirrored?

by Wumbologist on Sat Jan 05, 2019 11:16 am

That's exactly what I was showing in the last two pictures. Here's a video this time. First it's working after being uploaded, then not working after being unplugged, then working again after being reset:
https://i.imgur.com/omyghsS.gifv

Wumbologist
 
Posts: 12
Joined: Fri Dec 28, 2018 1:41 am

Re: 3.5" TFT FeatherWing display mirrored?

by adafruit_support_carter on Mon Jan 07, 2019 2:16 pm

It may be a race condition with initial power. Try adding some delay before the display is initialized to the example. Add it before this line:
https://github.com/adafruit/Adafruit_HX ... ng.ino#L75
so that is looks like:
Code: Select all | TOGGLE FULL SIZE
delay(1000);
tft.begin();

adafruit_support_carter
 
Posts: 11681
Joined: Tue Nov 29, 2016 2:45 pm

Re: 3.5" TFT FeatherWing display mirrored?

by Wumbologist on Tue Jan 08, 2019 10:44 am

That seems to have fixed it. I guess I'll put a delay on the first line of all my setups now, just in case whatever hardware I'm using has an issue with initial power like this. Seems like a decent practice, even if it's still a workaround.

Wumbologist
 
Posts: 12
Joined: Fri Dec 28, 2018 1:41 am

Re: 3.5" TFT FeatherWing display mirrored?

by adafruit_support_carter on Tue Jan 08, 2019 12:22 pm

Cool, glad that worked. You can also try lowering the delay amount. I just picked a crazy large amount as a way to test. try something more like 10 or 100 ms.

This is a general issue that comes up with displays. We've seen it with OLEDs and have this:
https://learn.adafruit.com/adafruit-ole ... leshooting
but something similar might be happening with the TFTs also.

adafruit_support_carter
 
Posts: 11681
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.