2025-02-23 11:29 AM - last edited on 2025-02-25 12:56 AM by mƎALLEm
Hi all
I am using stm32H747I-disco board .Can anyone please help with the example to control the brightness of the display
Thank you.
2025-02-23 11:39 PM
Back light is controled by CABC pin , however this pin did not connect to mcu, so it can't be control.
2025-02-24 12:07 AM
Hello,
See also this thread.
2025-02-24 12:57 AM
"R4" is marked "N/A", does it mean that the R4 resistor is not installed, so the backlight is controlled by CABC instead of BL_CTRL?
2025-02-24 1:00 AM
N/A means Not Applicable: not soldered by default.
"so the backlight is controlled by CABC instead of BL_CTRL?"
-> Most probably yes.
2025-02-24 10:15 AM
Thanks for confirming.
But to control brightness of the screen I found an example but it does not have interaction with hardware.
I found the this function in touchgfxhal.cpp
2025-02-24 1:14 PM - edited 2025-02-24 11:45 PM
In the view, try that:
extern "C" {
void LCD_SetBrightness(int value);
}
/* Set the brightnessto 100% at the screen startup */
void Screen1View::setupScreen()
{
Screen1ViewBase::setupScreen();
LCD_SetBrightness(100);
}
2025-02-24 9:42 PM - edited 2025-02-24 9:43 PM
I haven’t actually implemented the backlight adjustment function myself. I only spent some time working with TouchGFX on this MCU, so if I make any mistakes, please feel free to correct me.
From the schematic, the screen backlight is controlled by the STLD40DPUR chip. According to its datasheet, the backlight brightness should be adjusted using a PWM signal. However, the PJ12 pin does not support PWM functionality. If R4 is populated, it should be possible to control the backlight using this method.
As for the sample code you mentioned, it includes a backlight adjustment function because TouchGFX sample codes support multiple development boards, and STM32H747-DISCO is just one of them. This particular code is likely not applicable to this board.
2025-02-25 12:54 AM
It seem that the Backlight is controlled over CABC signal by default. You don't need to modify anything on the board. It seems the backlight is controlled by the LCD controller itself.
I tested the control of the backlight using void LCD_SetBrightness(int value) declared in TouchGFXHAL.cpp.
For example in Model.cpp:
#include <gui/model/Model.hpp>
#include <gui/model/ModelListener.hpp>
extern "C" {
void LCD_SetBrightness(int value);
}
Model::Model() : modelListener(0)
{
}
volatile int i;
void Model::tick()
{
LCD_SetBrightness(i/60);
i++;
if(i>6000) i = 0;
}
This changes the backlight progressively.
Hope that helps.