0

How disable the TFT 1.54" display on the BrainCraft HAT
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

How disable the TFT 1.54" display on the BrainCraft HAT

by leolee8774 on Wed Apr 14, 2021 9:38 pm

Hello,

I have setup my BrainCraft HAT by following the instruction and the TFT 1.54" display works well.

Now I want to know how can I turn off the TFT diaplay and re-use the HDMI display? And is there a way that the TFT display can be disabled automatically when I connect to a HDMI display? Thanks.

Regards,

Leo

leolee8774
 
Posts: 1
Joined: Wed Apr 14, 2021 9:26 pm

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by mikeysklar on Fri Apr 16, 2021 11:32 am

Leo,

Good question. I've not seen a way to detect the HDMI monitor presence so that you can automate this process. However, here are some things you can try.

This python script shoudl disable the display backlight on the BrainCraft TFT.

Code: Select all | TOGGLE FULL SIZE
# Turn on the Backlight
backlight = DigitalInOut(board.D26)
backlight.switch_to_output()
backlight.value = True


Does anything show up from dmesg or or other system log files as you insert the HDMi cable into your Pi? If so, you could setup a script that monitors the log file and calls the above python code. Hacky, I know,

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

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by marc_woohoo on Wed Apr 28, 2021 12:39 pm

mikeysklar

I'm also trying to figure out how to use my external monitor instead of the tiny TFT 1.54 display. I've tried running your python script, but nothing happened. Is there any other workaround I could try?

marc_woohoo
 
Posts: 1
Joined: Wed Apr 28, 2021 12:37 pm

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by mikeysklar on Wed Apr 28, 2021 2:57 pm

The BrainCraft HAT has pretty much the same LCD setup as the 1.3" TFT Bonnet for a Pi. You should be able to follow those instructions to set the BrainCraft HAT to boot to console and as long as your HDMI cable is plugged in at boot your monitor should be your main display.

Code: Select all | TOGGLE FULL SIZE
cd ~
sudo pip3 install --upgrade adafruit-python-shell click==7.0
sudo apt-get install -y git
git clone https://github.com/adafruit/Raspberry-Pi-Installer-Scripts.git
cd Raspberry-Pi-Installer-Scripts
sudo python3 adafruit-pitft.py --display=st7789_240x240 --rotation=0 --install-type=console


https://learn.adafruit.com/adafruit-1-3 ... le-install

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

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by geekguy on Mon May 17, 2021 2:26 am

Hi,

Your script does not get the desired results. Nothing goes to HDMI. Did you test this script?

8-Dale

geekguy
 
Posts: 302
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by mikeysklar on Mon May 17, 2021 8:24 pm

8-dale,

I've never run this with the Braincraft, but we use this script on all our PiTFTs.

Go ahead and post your /boot/config.txt and we will take a look at override options.

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

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by geekguy on Fri May 21, 2021 12:52 pm

mikeysklar wrote:Go ahead and post your /boot/config.txt and we will take a look at override options.
OK, here it is.

8-Dale
Attachments
brainy.config.txt
This is config.txt from the rPi 4 I have the Braincraft HAT on.
(2.11 KiB) Downloaded 3 times

geekguy
 
Posts: 302
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by mikeysklar on Sun May 23, 2021 3:26 pm

8-Dale,

Can you comment out the Adafruit section that our script adds-in at the end of /boot/config.txt?

Code: Select all | TOGGLE FULL SIZE
# --- added by adafruit-pitft-helper Sun May 16 23:18:59 2021 ---
hdmi_force_hotplug=1
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=drm-minipitft13,rotate=0,fps=60
# --- end adafruit-pitft-helper Sun Ma


Then boot from HDMI to confirm that all works correctly. I think in this scenario you are going to have to use two seperate /boot/config.txt files one without the piTFT code and another with it that you switch between to use the display or HDMI.

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

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by geekguy on Sun May 23, 2021 5:35 pm

mikeysklar wrote:Can you comment out the Adafruit section that our script adds-in at the end of /boot/config.txt?

I did that and I do not get a display on HDMI or the TFT. So, I uncommented that section, rebooted, and am back to the TFT being my only display. I have to SSh in to brainy in order to do anything on it.

8-Dale

geekguy
 
Posts: 302
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by mikeysklar on Mon May 24, 2021 11:56 am

Okay, we should be able to get HDMI going by keeping the Adafruit TFT lines at the bottom commented out. Then proceed to uncomment these lines forcing a safe strong HDMI signal.

Code: Select all | TOGGLE FULL SIZE
hdmi_safe=1
hdmi_drive=2
config_hdmi_boost=4

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

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by geekguy on Mon May 24, 2021 2:01 pm

mikeysklar wrote:Okay, we should be able to get HDMI going by keeping the Adafruit TFT lines at the bottom commented out. Then proceed to uncomment these lines forcing a safe strong HDMI signal.

Code: Select all | TOGGLE FULL SIZE
hdmi_safe=1
hdmi_drive=2
config_hdmi_boost=4

OK, this is working, but not completely. I do have everything going to HDMI now. That is good, however, I am not getting the entire screen and the first few characters are cut off. I do not have use of the whole HDMI screen - just part right in the middle that has a grey background.

Progress!

8-Dale

geekguy
 
Posts: 302
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: How disable the TFT 1.54" display on the BrainCraft HAT

by mikeysklar on Mon May 24, 2021 4:26 pm

Glad to hear it.

You might be able to move the safe line. I suspect that is reducing resolution and causing the cutoff.

Code: Select all | TOGGLE FULL SIZE
hdmi_safe=1


You can run adjust the resolution from a terminal:

Code: Select all | TOGGLE FULL SIZE
sudo raspi-config
Display Options
Resolution


I think the above might save a resolution to your /boot/config.txt (not positive), but the idea here is too have an config-hdmi.txt and config-braincraft.txt that you can switch between with a manual reboot. Hardly ideal, but a start.

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

Please be positive and constructive with your questions and comments.