Uncategorized

TFT LCD Backlight notes

Q: Is it possible to turn off my TFT backlight?

Wayne WernerI’ve got a TFT screen that uses the goodtft MHS35-show script. The screen works, and hooray, that’s great! Except… It stays on, all the time, at full brightness. I would love to be able to turn my screen off – I realize that I can’t control the backlight, due to the hardware. But if I could j…

Wayne Werner
Wayne Werner
It has several pins listed as “power supply”
Ephemeral

Ephemeral
2368
I am currently reading ILI9486_Datasheet7.3. CABC (Content Adaptive Brightness Control) and 8.2.39. Write CTRL Display Value (53h)  where I can see: BL: Backlight Control On/Off
I read also this : vcgencmd set_backlight Currently unusable, might be used in the future to control the backlight of LCD displays , maybe try this command ?
Wayne Werner
Wayne Werner
I didn’t have that command, and didn’t find it in apt search…
Ephemeral
Ephemeral
This command is on Raspbian for sure, what is your OS ?
Wayne Werner
Wayne Werner
Raspbian 😬 …
Ephemeral
Ephemeral
Wed 8:55
Can you put the output of this command please ? uname -a
Ephemeral

Ephemeral
2368
Wed 9:12
Can you also put your exact TFT screen model please, as I have deduced the model but I’m not sure what I’m looking for finally. Thank you
If your screen really use ILI9486 , here is a good starting point I think : github.com/juj/fbcp-ili9341/…
void TurnBacklightOff() : github.com/juj/fbcp-ili9341/…
Ephemeral
Ephemeral
Wed 9:39
You can read this also : On/Off Using STMPE GPIO on learn.adafruit.com/…, maybe it can be help you
Wayne Werner
Wayne Werner
Wed 10:37
Linux myhost 4.19.97+ #1294 <date> armv6l GNU/Linux
Wayne Werner

Wayne Werner
Wed 11:02
Hm, my bad looks like I do have the vcgencmd
but, set_backlight 1 and set_backlight 0 does nothing
nor does display_power 0/1
9 hours later…
Ephemeral
Ephemeral
Wed 20:21
This file is present on your system when you have the TFT screen : file /sys/class/backlight/soc\:backlight/brightness' ?
tlfong01

tlfong01
2858
Wed 21:08
@Ephemeral Sorry for the interruption. I must confess that I have very little experience in playing with LCD screen. So I am just brainstorming. Now I am reading and thinking aloud, commenting as I go along. I might make more than a couple of comments when hopping between datasheets, without any clear goal in mind. So you don’t need to reply to my comments immediately.
Now I have googled some documents to read, to get a rough idea of the LCD display. References: (1) AliExpress MHS 3.5 inch for raspberry Pi color TFT LCD screen supports retropie games – US$12
fr.aliexpress.com/item/…

(2) MHS3528 User Manual V1.0
lcdwiki.com/res/MHS3528/…

(3) IliTek ILI9486 a-Si TFT LCD Single Chip Driver 320RGBx480 Resolution and 262K-color Specification Preliminary Version: V0.06 2011/05/11
Document No: ILI9486L_DS_V006.pdf

(see full text)

Ephemeral
Ephemeral
I understand , no problem
tlfong01

tlfong01
2858
I am summarizing Ref 1 above. Just a quick and dirty write up. Not proof read at all.
LCD 3.5″, 320×480, resistive touch screen, 125MHz SPI, Rpi refresh rate 50Hz, play video games OK,
Supports FBCP driver, dual screen display, same size as raspberry Pi, compatible with any version of Rpi (fits into Rpi 26 pin header) Supports Rpi, Ubuntu, Kali
tlfong01

tlfong01
2858
Wed 21:36
Now I have jotted down some important points of Ref 2: SKU MHS3528, Display controller ILI9846, Touch panel controller XPT2048, 125MHz SPI, 26pin connector, instructions to install/compile driver to Rpi, can switch back to HDMI to do calibration. Next step is to read the 200+ pages ILI9486 datasheet. Might take some time. 🙂
tlfong01

tlfong01
2858
Wed 21:58
Now I have skimmed the ILI9486 data sheet. Summary:
Section 3, page 9 – Block Diagram, Section 4, page 10 – Pin descriptions,
Section 6, page 22, MCU interface,
Section 7, page 24, – 9/18 bit parallel or 3/4 line SPI interface.

Note, there is NO BACK LIT control circuit in this LCD display controller. I am no surprised, because my experience with other LCD display modules is that the back lit hardware is usually

Ephemeral
Ephemeral
😦 thanks anyway for taking the time to watch.
tlfong01
tlfong01
LED, and controlled by a MPU or IO expander GPIO High Low signal.
So far so good. Ah, bed time! I call it a day. See you tomorrow. Cheers.
Ephemeral
Ephemeral
thanks you again and good night 🙂
Wayne Werner
Wayne Werner
Wed 22:40
@Ephemeral I don’t have anything in /sys/class/backlight unless I put it there
16 hours later…
tlfong01

tlfong01
2858
Thu 14:16
Errata and apology about ILI9846’s back lit control pin – Earlier I skimmed the datasheet and wrongly concluded that the display chip does have any back lit control circuit and pins. It was only after I read your comments and read the datasheet a second time then I found that ILI9846 INDEED CAN DO BACK LIT CONTROL, as elaborated by the pictures below:
user image
user image
user image
So the smart LCD display chip can do something called “brightness” and “back light dimming” control. So I guess we can fiddle with the relevant registers using Rpi SPI commands and do real time brightness and back lit dimming control. In other words, we can keep using the existing driver, but do the real time brightness/backlit control using Rpi python SPI functions. Ah, almost afternoon tea time. So I am taking a break to prepare tea. See you later this evening or tomorrow. Cheers.
8 hours later…
tlfong01

tlfong01
2858
Thu 22:07
Since the MHS3528 module is actually a Rpi 26pin
user image
Last message was too late to edit, so continues here. Since the module is actually is Rpi 26 pin HAT, so it should be easy to use python or bash to SPI write to the back lit PWM register to see if the module display back light changes or explodes.
Anyway, I am going back to read Lady Ada’s tutorial on backlit control. References:
(4) LCD Panels – Backlights & Brightness – DigitalView, 2017jan
digitalview.com/blog/…

(5) Rpi Touch Screen LCD TFT Backlight Control using PWM GPIO pin (STMPE610 touchscreen controller) – Lady Ada
learn.adafruit.com/….

Ref 4 by DigitalView is a good read, tells many advanced things including how to use a sensor to check ambient light and adjust brightness and back light accordingly. Ref 5 by Lady Ada is also good, saying that they actually designed their LCD module that can control backlit in two ways:
(a) PWM Backlight Control with GPIO 18

(b) [AdaFruit] designed the board with the STMPE610 touchscreen controller which has 2 extra GPIO and tied one of them to control the backlight. You can use the command line to control the backlight.

(see full text)

So I read that Lady Ada’s touch screen controller has two GPIO pins to do backlit control. Now I need to check if MHS3528’s XPT2048 touch panel controller also has GPIO pins to do backlit control. Ah, bed time again. I call it a day. Cheers.
14 hours later…
tlfong01

tlfong01
2858
Fri 12:09
And there seems to be some confusion about the back lit pin. Lady Ada’s touch screen controller STMPE610 has a GPIO pin used to control back lit. But MHS3528’s XPT2048 does not have any GPIO pin to control backlit. I read ILI9341/9486 driver program and it seems that the reset and back lit pins etc are defined by the user.
However, MHS3528 might not have connected ILI9341’s CABC_ON and CABC_PWM pins to the backlit LED circuit. Instead the LED circuit is hardwired to always on. If that is the case, then either @Ephemeral’s suggestion to modify the kernel, or my suggestion to python/bash SPI modify the ILI9341’s CABC registers is a waste of time.
Then my other suggestion might work: remove the SMD backlit LED series current limiting resistor, extract the two connecting wires and DIY Rpi GPIO PWM pin to control back lit, … Anyway, I have snipped the backlit functions of the juj FBCP ILI934/9486 kernel for reference. My brainstorming suggestion is coming to an end. Comments and counter suggestions welcome.
user image
The last message was posted 2 days ago.
tlfong01
//

Categories: Uncategorized

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.