cancel
Showing results for 
Search instead for 
Did you mean: 

How to turn on/off LCD backlight in STM32F769-Discovery board?

RCres.1
Associate III

Hi,

I am new on microcontrollers and I am starting with STM32F769-Discovery. I need to turn on/off the LCD backlight.

I have been taking a look on schematics and it seems it can be done by LCD_BL_CTRL, which is connected to PI14.

https://www.st.com/resource/en/user_manual/dm00276557-discovery-kit-with-stm32f769ni-mcu-stmicroelectronics.pdf

However, I have no clear how to configuring PI14 to use it to control the backlight. This is what I have

__HAL_RCC_GPIOI_CLK_ENABLE();
 
GPIO_InitTypeDef GPIO_InitStructure;
 
 GPIO_InitStructure.Pin     = GPIO_PIN_14;
 GPIO_InitStructure.Mode    = GPIO_MODE_OUTPUT_PP; 
 
//GPIO_MODE_OUTPUT_OD not  working too
 
HAL_GPIO_Init(GPIOI,&GPIO_InitStructure);

Any idea?

Kind Regards,

Rafa

4 REPLIES 4
LMI2
Lead

Hi, well I was just showing the configuration lines.

Of course, I am using the HAL_GPIO_WritePin(GPIOI, 14, GPIO_PIN_RESET) for turning off the backlight.

But it does not work, so I suspect the GPIO_InitStructure is wrong.

Any idea?

Kind Regards

LMI2
Lead

Hi.

"Of course, I am using the HAL_GPIO_WritePin(GPIOI, 14, GPIO_PIN_RESET) for turning off the backlight." Yes, I thought so too but had to check. I have no idea who you are or what you do.

I use CubeMx and HAL_GPIO_WritePin seem to work well. Can you check with a DVM that pin 14 changes when you program it. That would tell is this a SW or HW problem and everything is possible with these boards. From Cube you'll get a main.c where pin commands work.

I could turn off the LCD of STM32F746 discovery board with a software call, but I don't remember how, it was a couple years ago.

Piranha
Chief II

https://www.st.com/en/development-tools/b-lcd40-dsi1.html

https://www.st.com/resource/en/user_manual/dm00321394--4inch-wvga-tft-lcd-board-with-mipi-dsi-interface-and-capacitive-touch-screen-stmicroelectronics.pdf

Look at the schematics for that pin - by default it's connected to CABC (content adaptive backlight control). Probably try forcing DSI_RESET into one state or another.