10 years, 10 months ago.

PWM and DeepSleep

I'm working on a bare metal project using the LPC1768 and the mbed library. My project has a touchscreen display with backlight LEDs. If the screen isn't touched for 1 minute, I dim the LEDs using a PWM and then put the LPC1768 into deep sleep mode to save battery life. It is woken up from deep sleep when the screen is next touched.

The problem I have is that the PWM needs the PLL clock, so once the processor goes into deep sleep, the screen flashes erratically. Does anyone know if it's possible to use a different clock source for the PWM that is not switched off in deep sleep (e.g. the 32768Hz crystal or Watchdog Timer Clock)?

Thanks for any suggestions. Tim

1 Answer

10 years, 10 months ago.

From the datasheet the PWM module can get clock input from either system clock, or capture inputs. IF the PWM isn't powered down, it might work to for example short your 32kHz crystal to a PWM input capture pin and let it work on that. But I have no idea if that will actually work.

Thanks for your suggestion Erik. I've eventually solved this problem by switching the PWM output to a GPIO when it has finished dimming the LEDs. I've added a resistor across the MOSFET so that the LEDs still get a small amount of current when the MOSFET is off leaving enough light for the user to see that the display is on.

posted by Tim Barry 30 Jul 2013