2020-04-03 12:31 AM
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.
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
2020-04-03 08:51 AM
Your code sample doesn't show this
HAL_GPIO_WritePin(GPIOI, 14, GPIO_PIN_RESET); //or GPIO_PIN_SET
2020-04-03 10:31 AM
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
2020-04-03 03:01 PM
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.
2020-04-04 12:30 AM
https://www.st.com/en/development-tools/b-lcd40-dsi1.html
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.