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:
@@ -27,9 +27,11 @@
|
||||
//#define DCDC_MODE_INIT MODE_NANOGRID
|
||||
|
||||
// basic battery configuration
|
||||
#define BATTERY_TYPE BAT_TYPE_GEL // GEL most suitable for general batteries (see battery.h for other types)
|
||||
#define BATTERY_NUM_CELLS 6 // For lead-acid batteries: 6 for 12V system, 12 for 24V system
|
||||
#define BATTERY_CAPACITY 40 // Cell capacity or sum of parallel cells capacity (Ah)
|
||||
#define BATTERY_TYPE BAT_TYPE_GEL ///< GEL most suitable for general batteries (see battery.h for other types)
|
||||
#define BATTERY_NUM_CELLS 6 ///< For lead-acid batteries: 6 for 12V system, 12 for 24V system
|
||||
#define BATTERY_CAPACITY 40 ///< Cell capacity or sum of parallel cells capacity (Ah)
|
||||
|
||||
#define LOAD_OVERCURRENT_RECOVERY_TIMEOUT (5*30) ///< Seconds to wait until load is switched back on after an overcurrent event
|
||||
|
||||
#define DEVICE_ID 12345678
|
||||
|
||||
|
||||
Reference in New Issue
Block a user