2020-07-28 01:47 AM
In STM32F7 controller is there a way to detect low power mode in software and how long controller will work before it completely shuts off.
2020-07-28 02:22 AM
Measure the power supply using ADC. You can measure it indirectly by measuring VREFINT, if VREF+ is connected to VDDA (and that in turn to VDD). You can use the ADC watchdog function to automate this task and be alerted in an interupt.
> how long controller will work before it completely shuts off
That of course depends entirely on your board design (mainly capacitances in the power lines) and the total consumption of the board.
JW
2020-07-29 07:31 AM
thanks JW,
I was looking for some options in firmware itself without adding any hardware circuit, I see in STM32F7xx ther is one feature called power supply supervisor
I referred section 4.2 and thinking to implement it in following way,
Ref – STM32F7xx Ref Manual - 4.2 Power supply supervisor
1. Use PVD to monitor the VDD power supply by comparing it to a threshold selected by the PLS [2:0] bits in the PWR power control register (PWR_CR1).
2. Enable PVD by setting the PVDE bit
3. Monitor PVDO flag in the PWR power control/status register (PWR_CSR1), it will indicate if VDD is higher or lower than the PVD threshold.
4. This event is internally connected to the EXTI line16 and can generate an interrupt if enabled through the EXTI registers.
5. If EXTI interrupt occurs, service routine could perform emergency shutdown tasks.
6. Once EXTI interrupt occurs, trigger one timer wherein we can handle critical tasks to safely close the system.
7. Timer will handle FATfs(to open/write/close critical info to a file), to inform main unit about system trouble etc.