0

Issues with Backlight control 2.8" Capacitive PiTFT
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Issues with Backlight control 2.8" Capacitive PiTFT

by Reelswim on Thu May 27, 2021 12:33 pm

I have an issue with controlling the backlight on the Capacitive 2.8" PiTFT.

My setup is a little complicated: My application is a system of time-synchronized video cameras recording video of a swim meet from different angles, recording constantly for 10+ hours. I need a way to power the system entirely from batteries as well as keep the Pi's in nearly perfect sync over that time using a DS3231 RTC module. Fortunately, I found a board that has both the functionality to power it from a battery as well as an onboard DS3231 I could use - the PiUPS from PiShop (https://www.pishop.us/product/raspberry-pi-ups-hat/). I stack that on a RPi 3B+ to power the Pi, and then stack a 2.8" Capacitive PiTFT on top to provide button input as well as a way to view the video display. The system works great, but there is a problem related to the backlight control that I need some help with.

In order to conserve battery power, I turn the backlight of the display off after 2 minutes of inactivity, and back on whenever a user presses a button. I'm using GPIO18 to do this by toggling the pin from low to high. This also works well. The problem appears at two different times:

1. If I plug the Pi into USB power for a while and then unplug it, after 10 seconds the Pi shuts down. According to PiShop engineers, the PiUPS will shut the system down if it detects GPIO18 high. Something must be setting it high when I unplug the USB power.

2. When the user wants to shut the system down, they can do it by pressing a button. After the system goes through my shutdown process, the screen goes black - but then it suddenly turns back on and will glow like that forever if I don't cut the power from the battery (which also erases the time value in the RTC, which isn't good).

So, my question is whether I could use a different GPIO or a different method not involving GPIO18 to turn the backlight on or off?

I would really appreciate any help you can give me on this. Thank you!!

Reelswim
 
Posts: 6
Joined: Sat Oct 13, 2018 9:36 am

Re: Issues with Backlight control 2.8" Capacitive PiTFT

by Reelswim on Thu May 27, 2021 4:18 pm

I checked the value of GPIO18 while my system is running. The value is 0 when the backlight is off, and 1 when the backlight is on. When I run the shutdown sequence (while the backlight is on, using <<shutdown>>), the value remains 1 until the system shuts down, but the moment before shutdown the pin returns to Hi-Z state, which turns the backlight back on. The backlight will remain on, burning battery, even though the Pi is shut down.

I just wish there was a different way to turn on/off the backlight other than GPIO18 - is there?

Reelswim
 
Posts: 6
Joined: Sat Oct 13, 2018 9:36 am

Re: Issues with Backlight control 2.8" Capacitive PiTFT

by mikeysklar on Thu May 27, 2021 5:27 pm

@Reelswim,

This is a really cool Pi application. Do you have an example screenshot or video of what the time-synced swim meets look like?

There is a jumper on the 2.8" PiTFT that you can cut (#18 Lite). That removes GPIO 18 from having access to the backlight. If you still want to control the backlight you could manually solder a trace to a free GPIO.

If you'd like to not have #18 control the backlight, simply cut the solder jumper, the tiny trace between the two large gold pads marked Lite #18


https://learn.adafruit.com/adafruit-pit ... -2859119-2

18-lite.jpeg
18-lite.jpeg (68.6 KiB) Viewed 135 times

mikeysklar
 
Posts: 5020
Joined: Mon Aug 01, 2016 8:10 pm

Re: Issues with Backlight control 2.8" Capacitive PiTFT

by Reelswim on Thu May 27, 2021 5:39 pm

Thank you! If I manually solder a trace to a free GPIO, which side of that pad do I need to connect to a GPIO pin? That is a huge pain, actually - since shutting down a pi using Shutdown automatically sets GPIO18 high at the end, that means that no matter what, the backlight will remain on as long as there's battery power available...

Here is an example of the videos I create automatically: https://youtu.be/fmgOZvTOipA

Reelswim
 
Posts: 6
Joined: Sat Oct 13, 2018 9:36 am

Re: Issues with Backlight control 2.8" Capacitive PiTFT

by mikeysklar on Fri May 28, 2021 2:08 pm

Hey that swim reel is awesome. I love how fast the lane overlays with swimmer info appear and slide away. Also how you cut to the kick turns with an underwater setup.

Which model of the 2.8" PiTFT are you using? Is it the Plus that has dual 2x20 connectors male and female or the original that has 2x13 connectors?

I took a look a the PiTFT Plus Eagle PCB file. The upper pad closer to the digital '8' of #18 runs back to the Pi GPIO connector. The lower side closer to the '#' sign goes to the display.

Screen Shot 2021-05-28 at 11.02.09 AM.png
Screen Shot 2021-05-28 at 11.02.09 AM.png (158.55 KiB) Viewed 118 times


You would cut the center trace of the #18 LITE pad and then solder a different GPIO to the lower side (near the '#' sign) if that is what is necessary.

mikeysklar
 
Posts: 5020
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.