cancel
Showing results for 
Search instead for 
Did you mean: 

How to turn on/off backlight of STM32H747I_DISCO board

Louie88
Associate III

I would like to turn off the backlight if the LCD module of STM32H747I_DISCO board. I figured out that the PJ12 (LCD_BL_CTRL, PORT = J PIN = 12) probably controls the backlight of the LCD module (from schematics). The "PJ12" is initialized in "main.MX_GPIO_Init()" and it is set to output to level low (GPIO_PIN_RESET) during POR. 

I tried to set PJ12 to high and low with the follow HAL call:

 

 

void Screen1View::handleTickEvent()
{
	if (++tickCount >= ScreenUpdateCount)
	{
		tickCount = 0;
		updateScreen();
		if (++lcdBackLightCount >= TurnOffLcdBacklightCount)
		{
			lcdBackLightCount = 0;
			// Turn off LCD
			HAL_GPIO_WritePin(GPIOJ, LCD_BL_Pin, GPIO_PIN_SET);
			// HAL_GPIO_WritePin(GPIOJ, LCD_BL_Pin, GPIO_PIN_RESET);
		}
	}
}

 

 

 

but it did nothing. Backlight of the LCD stays always on.

The test app is based on TouchGFX.

Any idea?

Thanks,

Louis

 

6 REPLIES 6
mƎALLEm
ST Employee

Thread moved to STM32 MCUs Embedded forum board as it has no relation to the TouchGFX usage but to the BSP of the board.

Forget about TouchGFX for the moment, did you try to set/reset that pin and see what happens with the backlight?

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.
Louie88
Associate III

His SofLit,

I am sorry for the wrong forum. Yes, I did, please check my original post. I use HAL write pin method.

HAL_GPIO_WritePin(GPIOJ, LCD_BL_Pin, GPIO_PIN_SET);

Louis

Hello,

According to the LCD board schematic, it seems the back light control pin is not connected to the LCD back light controller input (EN):

mALLEm_0-1740125821484.png

You need to solder R4.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.
Dor_RH
ST Employee

Hello @Louie88,

Yes, it is the right function: 

HAL_GPIO_WritePin(GPIOJ, LCD_BL_Pin, GPIO_PIN_SET);

But try to configure the GPIO pin as bellow: 

GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;

GPIO_InitStruct.Pull = GPIO_NOPULL;

GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

I hope my answer has helped you. When your question is answered, please select this topic as solution that answered you, it will help others find that answer faster.

Thanks for your contribution.

Dor_RH

Thanks Dor_RH,

It is actually done in main.c MX_GPIO_Init() method:

20250221-MX_GPIO_Initpng.png

I think mƎALLEm is right (see above post). The R4 is really not assembled in MB166 LCD Module (See the attached microscope image) so the BL_CTRL (PJ12) GPIO output does nothing with the backlight enable pin. It is always connected to CABC pin which is a pin of the CN2 connector (whatever it is).  

Thanks,

Louis

Hi mƎALLEm,

Thanks for your valuable note, I think you are right. The R4 is really not assembled in MB166 LCD Module (See the attached microscope image) so the BL_CTRL (PJ12) GPIO output does nothing with the backlight enable pin. It is always connected to CABC pin which is a pin of the CN2 connector (whatever it is).  The R5 pullup resistor is also omitted...

Now the question is may I shortcut the CABC signal (whatever it is) with BL_CTRL to make the backlight control work?

Thanks,

Louis