Faster load short circuit protection via LPTIM

The PWM charge controllers don't have a fuse and need a reliable load short
circuit protection implemented in the microcontroller. The comparator
monitoring the load current now triggers LPTIM connected to the load
disable pin. This allows to switch off the load with a defined time delay
and glitch filter.

During tests, switching off the load in an ISR triggered by COMP2 did
not lead to reliable delays (especially in case of wake-up from sleep),
hence this alternative solution using LPTIM was implemented.

The load switch functions were moved from hardware.cpp to load.cpp.
This commit is contained in:
Martin Jaeger
2019-06-12 09:45:19 +02:00
parent f0301625d7
commit 0e91c834ac
5 changed files with 194 additions and 115 deletions
+1 -9
View File
@@ -20,17 +20,9 @@
/** @file
*
* @brief
* Hardware-specific functions like timers, output switches, bootloader
* Hardware-specific functions like timers, watchdog, bootloader
*/
/** Enable/disable load switch
*/
void hw_load_switch(bool enabled);
/** Enable/disable USB output
*/
void hw_usb_out(bool enabled);
/** Initialization of IWDG
*
* @param timeout Timeout in seconds