cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F746 Dimmer

carlos_112
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

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,

Gaetan Godart
Software engineer at ST (TouchGFX)

View solution in original post

4 REPLIES 4
GaetanGodart
ST Employee

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,

Gaetan Godart
Software engineer at ST (TouchGFX)
mƎALLEm
ST Employee

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:

mALLEm_0-1745414532886.png

mALLEm_1-1745414721918.png

Maybe you can use PWM in interrupt mode and toggle PK3 pin in it. I don't know if this is efficient.

 

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.
carlos_112
Associate II

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!

 

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,

Gaetan Godart
Software engineer at ST (TouchGFX)