2025-04-22 6:32 PM
Hello!
I wonder if anyone has had experience making a dimmer on an STM32F746? For example, want the display to dim after 1 minute of being idle. It should remain bright enough to read, then return to full brightness on touch.
I saw some posts that PWM should be used with a Timer pin, but this doesn't appear to be an option on the STM32F746?
Thanks,
the Windmill
Solved! Go to Solution.
2025-04-23 7:54 AM
I don't see why you couldn't.
Here it is not possible it seems because that probably wasn't one of our priorities so we connected the backlight controller pin to a standard pin but you could connect it to a PWM pin or maybe even if the display support it to an analog pin (I am not sure about displays capabilities).
Regards,
2025-04-23 6:14 AM
Hello @carlos_112 ,
The simplest way would be to increment a counter in the handleTickEvent to reach 60 (number of ticks per second) * 60 (number of second in one minute) so 3600.
This way, after 1 minute, you will reach 3600, at that moment you can add a black box with alpha = 0 and slowly increase the alpha value to your desired diming.
Finally, you can use handleClickEvent and handleDragEvent to set the counter back to 0 when a touch happen.
Alternatively, you could use a time instead of a counter, control the backlight of the display instead of adding a box with alpha value and use the touchController's interrupt instead of the handleClickEvent.
Regards,
2025-04-23 6:24 AM - edited 2025-04-23 6:25 AM
Hello,
Unfortunately you cannot use PWM output with that board as the LCD_BL_CTRL control pin is connected to PK3 that doesn't support any TIM/PWM output:
Maybe you can use PWM in interrupt mode and toggle PK3 pin in it. I don't know if this is efficient.
2025-04-23 7:40 AM
Hello!
I assume that using the alpha will not actually cause the backlight to dim? Can you tell me if it would be advisable to use the PWM to cause the backlight to dim? If so, can we use an external display with the backlight connected to a TIM/PWM pin?
Thank you!
2025-04-23 7:54 AM
I don't see why you couldn't.
Here it is not possible it seems because that probably wasn't one of our priorities so we connected the backlight controller pin to a standard pin but you could connect it to a PWM pin or maybe even if the display support it to an analog pin (I am not sure about displays capabilities).
Regards,