Index: trunk/fw_g473rct/SES/inc/battery_voltage.h
===================================================================
--- trunk/fw_g473rct/SES/inc/battery_voltage.h	(revision 37)
+++ trunk/fw_g473rct/SES/inc/battery_voltage.h	(revision 38)
@@ -16,5 +16,16 @@
 
 //--- GLOBALE DEFINES ----------------------------------------------------------
-#define BATTERY_VOLTAGE_VOLTAGE_DIVIDER       6.0
+#if defined SYSTEM_VOLTAGE_12V
+  #define BATTERY_VOLTAGE_VOLTAGE_DIVIDER       6.0
+#elif defined SYSTEM_VOLTAGE_24V
+  #define BATTERY_VOLTAGE_VOLTAGE_DIVIDER       11.0
+#elif defined SYSTEM_VOLTAGE_48V
+  #define BATTERY_VOLTAGE_VOLTAGE_DIVIDER       21.0
+#else
+  #error "System voltage not defined"
+#endif
+
+
+
 #define BATTERY_VOLTAGE_ADC_RESOLUTION		  32768.0 //65536/2 da im differential mode
 #define BATTERY_VOLTAGE_ADC_OFFSET			  32768.0
Index: trunk/fw_g473rct/SES/inc/outputs.h
===================================================================
--- trunk/fw_g473rct/SES/inc/outputs.h	(revision 37)
+++ trunk/fw_g473rct/SES/inc/outputs.h	(revision 38)
@@ -30,4 +30,5 @@
 #define OUTPUTS_LVP_SHUNT_UNDERTEMPERATURE		5
 #define OUTPUTS_LVP_CHIP_UNDERTEMPERATURE		6
+#define OUTPUTS_LVP_SHORT_PROTECTION			7
 
 #define OUTPUTS_OVP_UNKNOWN						-1
@@ -39,4 +40,5 @@
 #define OUTPUTS_OVP_SHUNT_UNDERTEMPERATURE		5
 #define OUTPUTS_OVP_CHIP_UNDERTEMPERATURE		6
+#define OUTPUTS_OVP_SHORT_PROTECTION			7
 
 #define OUTPUTS_LVP_MODE_AUTO					0U
Index: trunk/fw_g473rct/SES/inc/sysdata.h
===================================================================
--- trunk/fw_g473rct/SES/inc/sysdata.h	(revision 37)
+++ trunk/fw_g473rct/SES/inc/sysdata.h	(revision 38)
@@ -189,6 +189,8 @@
 	/* 2 of 8 */ uint16_t ovp_sense;                                            // 168
 	/* 4 of 8 */ uint16_t lvp_sense;                                            // 169
-	/* 6 of 8 */ uint32_t detectedCapacityAtActualCRate;						// 170,171
-	/* 8 of 8 */ uint32_t detectedEnergyAtActualCRate;							// 172,173
+	/* 6 of 8 */ uint16_t overcurrentRetryCounter;								// 170
+	/* 8 of 8 */ uint16_t overcurrentEventsTotal;								// 171
+	/* 2 of 8 */ uint16_t overcurrentMeasurement;								// 172
+	/* 4 of 8 */ uint16_t overcurrentMaxValue;									// 173
 	/* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 174
 	/* 8 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 175
@@ -226,8 +228,6 @@
 	/* 8 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 239
 	/* 4 of 8 */ int64_t  mAs_AutoModeU;										// 240-243
-	/* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 244
-	/* 8 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 245
-	/* 2 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 246
-	/* 4 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 247
+	/* 6 of 8 */ uint32_t detectedCapacityAtActualCRate;						// 244,245
+	/* 8 of 8 */ uint32_t detectedEnergyAtActualCRate;							// 246,247
 	/* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 248
 	/* 8 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 249
Index: trunk/fw_g473rct/SES/smartPro.emProject
===================================================================
--- trunk/fw_g473rct/SES/smartPro.emProject	(revision 37)
+++ trunk/fw_g473rct/SES/smartPro.emProject	(revision 38)
@@ -6,6 +6,6 @@
     c_preprocessor_definitions="DEBUG"
     gcc_debugging_level="Level 3"
-    gcc_omit_frame_pointer="Yes"
     gcc_optimization_level="None" />
+  <configuration Name="Debug125A_24V" />
   <configuration
     Name="Release125A_12V"
@@ -14,4 +14,5 @@
     gcc_omit_frame_pointer="Yes"
     gcc_optimization_level="Level 2 balanced" />
+  <configuration Name="Release125A_24V" />
   <project Name="smartPro">
     <configuration
@@ -52,8 +53,14 @@
       Name="Debug125A_12V"
       arm_compiler_variant="gcc"
-      c_preprocessor_definitions="DEVICETYPE=125" />
+      c_preprocessor_definitions="DEVICETYPE=125;SYSTEM_VOLTAGE_12V" />
+    <configuration
+      Name="Debug125A_24V"
+      c_preprocessor_definitions="DEVICETYPE=125;SYSTEM_VOLTAGE_24V" />
     <configuration
       Name="Release125A_12V"
-      c_preprocessor_definitions="DEVICETYPE=125" />
+      c_preprocessor_definitions="DEVICETYPE=125;SYSTEM_VOLTAGE_24V" />
+    <configuration
+      Name="Release125A_24V"
+      c_preprocessor_definitions="DEVICETYPE=125;SYSTEM_VOLTAGE_24V" />
     <folder Name="CMSIS Files">
       <file file_name="STM32G4xx/Device/Include/stm32g4xx.h" />
@@ -76,4 +83,5 @@
         <file file_name="../Core/Inc/gpio.h" />
         <file file_name="../Core/Inc/i2c.h" />
+        <file file_name="../Core/Inc/iwdg.h" />
         <file file_name="../Core/Inc/main.h" />
         <file file_name="../Core/Inc/spi.h" />
@@ -90,4 +98,5 @@
         <file file_name="../Core/Src/gpio.c" />
         <file file_name="../Core/Src/i2c.c" />
+        <file file_name="../Core/Src/iwdg.c" />
         <file file_name="../Core/Src/main.c" />
         <file file_name="../Core/Src/rtc.c" />
@@ -123,4 +132,5 @@
         <file file_name="../Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_hal_i2c.h" />
         <file file_name="../Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_hal_i2c_ex.h" />
+        <file file_name="../Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_hal_iwdg.h" />
         <file file_name="../Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_hal_pcd.h" />
         <file file_name="../Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_hal_pcd_ex.h" />
@@ -168,4 +178,5 @@
         <file file_name="../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_i2c.c" />
         <file file_name="../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_i2c_ex.c" />
+        <file file_name="../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_iwdg.c" />
         <file file_name="../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_pcd.c" />
         <file file_name="../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_pcd_ex.c" />
Index: trunk/fw_g473rct/SES/src/ads1260.c
===================================================================
--- trunk/fw_g473rct/SES/src/ads1260.c	(revision 37)
+++ trunk/fw_g473rct/SES/src/ads1260.c	(revision 38)
@@ -45,8 +45,9 @@
 #include "ads1260.h"
 #include "spi.h"
-#include "math.h"
+//#include "math.h"
 #include "main.h"
 #include "eeprom.h"
 #include <stdio.h>
+#include "iwdg.h"
 //      --- EXTERNE VARIABLEN --------------------------------------------------------
 
@@ -765,4 +766,5 @@
   /* 3*/ HAL_GPIO_WritePin(ADC_START_CONV_GPIO_Port, ADC_START_CONV_Pin, GPIO_PIN_SET);
          HAL_Delay(150); // Delay weil die Vref braucht zeit um sich zu stabilisieren (siehe Datenblatt Seite 9)
+		 HAL_IWDG_Refresh(&hiwdg);
   /* 1*/ //HAL_GPIO_WritePin(ADC_POWER_DOWN_GPIO_Port, ADC_POWER_DOWN_Pin, GPIO_PIN_RESET);
          //HAL_Delay(150); // Delay weil die Vref braucht zeit um sich zu stabilisieren (siehe Datenblatt Seite 9)
@@ -771,6 +773,8 @@
   /* 2*/ HAL_GPIO_WritePin(ADC_RESET_GPIO_Port, ADC_RESET_Pin, GPIO_PIN_RESET);
          HAL_Delay(150); // Delay weil die Vref braucht zeit um sich zu stabilisieren (siehe Datenblatt Seite 9)
+		 HAL_IWDG_Refresh(&hiwdg);
   /* 2*/ HAL_GPIO_WritePin(ADC_RESET_GPIO_Port, ADC_RESET_Pin, GPIO_PIN_SET);
          HAL_Delay(150); // Delay weil die Vref braucht zeit um sich zu stabilisieren (siehe Datenblatt Seite 9)
+		 HAL_IWDG_Refresh(&hiwdg);
   /* 3*/ HAL_GPIO_WritePin(ADC_START_CONV_GPIO_Port, ADC_START_CONV_Pin, GPIO_PIN_RESET);
 
@@ -781,4 +785,5 @@
   /* 5*/ ADS_1260_SetExternalReference(&hspi3);
          HAL_Delay(150);
+		 HAL_IWDG_Refresh(&hiwdg);
   /* 6*/ ADS_1260_SetDataRate(&hspi3, DATA_RATE_20);
   //  /* 7*/ ADS_1260_SetDigitalFilter(&hspi1, FILTER_SINC4);
@@ -789,10 +794,14 @@
 
          ADS_1260_ActivateStatusData();
+		 HAL_IWDG_Refresh(&hiwdg);
          ADS_1260_ActivateLock();
+		 HAL_IWDG_Refresh(&hiwdg);
 
   /*10*/ //ADS_1260_SelfOffsetCalibration(&hspi1);
          HAL_Delay(150);
+		 HAL_IWDG_Refresh(&hiwdg);
   /*x*/  ads1260DataCoversionState = ADC_STATE_READY_FOR_CONVERSION;
          ADS1260_StartConversion();
+		 HAL_IWDG_Refresh(&hiwdg);
 }
 
Index: trunk/fw_g473rct/SES/src/battery_voltage.c
===================================================================
--- trunk/fw_g473rct/SES/src/battery_voltage.c	(revision 37)
+++ trunk/fw_g473rct/SES/src/battery_voltage.c	(revision 38)
@@ -17,6 +17,6 @@
 
 //	--- LOKALE DEFINES - bitte hier dokumentieren --------------------------------
+
 #define BATTERY_VOLTAGE_FILTER  32
-
 
 
Index: trunk/fw_g473rct/SES/src/eeprom.c
===================================================================
--- trunk/fw_g473rct/SES/src/eeprom.c	(revision 37)
+++ trunk/fw_g473rct/SES/src/eeprom.c	(revision 38)
@@ -223,13 +223,41 @@
 	/* iBatFull					*/											10,				// I-batt full 10%, 10A bei 100Ah akku
 	/* tBatFull					*/											2,				// t-batt full 2 Sekunden
-	/* uBatFull					*/											0,				// 14V olt Ubatt full, Neu: Bei 0: Erkung von Lipro LVP als 0% 
-	/* uBatEmpty				*/											11312,				// 11,312V Ubatt Empty
+#if defined SYSTEM_VOLTAGE_12V
+	/* uBatFull					*/											14000,				// 14V olt Ubatt full, Neu: Bei 0: Erkung von Lipro LVP als 0% 
+	/* uBatEmpty				*/											12400,				// 11,312V Ubatt Empty
+#elif defined SYSTEM_VOLTAGE_24V
+	/* uBatFull					*/											28000,				// 14V olt Ubatt full, Neu: Bei 0: Erkung von Lipro LVP als 0% 
+	/* uBatEmpty				*/											24800,				// 11,312V Ubatt Empty
+#elif defined SYSTEM_VOLTAGE_48V
+	/* uBatFull					*/											56000,				// 14V olt Ubatt full, Neu: Bei 0: Erkung von Lipro LVP als 0% 
+	/* uBatEmpty				*/											49600,				// 11,312V Ubatt Empty
+#else
+  #error "System voltage not defined"
+#endif
+
+
 	/* socCalcMode				*/											1,				// SoC calculation mode: 0(default)
 	/* cellRatedDischargeTime	*/											2,				// cell rated current discharge time [C/x]. For example, if 40Ah cell is rated as 0.5c, then rated discharge time is 2
-
+#if defined SYSTEM_VOLTAGE_12V
 	/* lvpStart	*/															12000,			// uint16_t lvpStart; Spannung ab der die LOW Voltage Protection aktiv wird in mV
 	/* lvpStop	*/															12500,			// uint16_t lvpStop; Spannung ab der die LOW Voltage Protection wieder inaktiv wird
 	/* ovpStart	*/															14800,			// uint16_t  ovpStart; Spannung ab der die OVER Voltage Protection aktiv wird in mV
 	/* ovpStop	*/															14000,			// uint16_t  ovpStop; Spannung ab der die OVER Voltage Protection wieder inaktiv wird
+#elif defined SYSTEM_VOLTAGE_24V
+	/* lvpStart	*/															24000,			// uint16_t lvpStart; Spannung ab der die LOW Voltage Protection aktiv wird in mV
+	/* lvpStop	*/															25000,			// uint16_t lvpStop; Spannung ab der die LOW Voltage Protection wieder inaktiv wird
+	/* ovpStart	*/															29600,			// uint16_t  ovpStart; Spannung ab der die OVER Voltage Protection aktiv wird in mV
+	/* ovpStop	*/															28000,			// uint16_t  ovpStop; Spannung ab der die OVER Voltage Protection wieder inaktiv wird
+
+#elif defined SYSTEM_VOLTAGE_48V
+	/* lvpStart	*/															48000,			// uint16_t lvpStart; Spannung ab der die LOW Voltage Protection aktiv wird in mV
+	/* lvpStop	*/															50000,			// uint16_t lvpStop; Spannung ab der die LOW Voltage Protection wieder inaktiv wird
+	/* ovpStart	*/															59200,			// uint16_t  ovpStart; Spannung ab der die OVER Voltage Protection aktiv wird in mV
+	/* ovpStop	*/															56000,			// uint16_t  ovpStop; Spannung ab der die OVER Voltage Protection wieder inaktiv wird
+#else
+  #error "System voltage not defined"
+#endif
+
+
 
 #if (DEVICETYPE == 500)
@@ -247,6 +275,6 @@
 	/* chargeStopHighTemperatureStart	*/									6000,			// 80°C int16_t chargeStopHighTemperatureStart;	Abschalttemperatur Ladung wegen zu hoher Temperatur
 	/* chargeStopHighTemperatureStop	*/									5500,			// 75°C int16_t chargeStopHighTemperatureStop;	Wiedereinschalttemperatur
-	/* chargeStopLowTemperatureStart	*/									-3000,			// -35°C int16_t chargeStopLowTemperatureStart;	Abschalttemperatur Ladung wegen zu niedriger Temperatur
-	/* chargeStopLowTemperatureStop		*/									-2500,			// -30°C int16_t chargeStopLowTemperatureStop; Wiedereinschalttemperatur
+	/* chargeStopLowTemperatureStart	*/									-2500,			// -35°C int16_t chargeStopLowTemperatureStart;	Abschalttemperatur Ladung wegen zu niedriger Temperatur
+	/* chargeStopLowTemperatureStop		*/									-2000,			// -30°C int16_t chargeStopLowTemperatureStop; Wiedereinschalttemperatur
 	/* dischargeStopHighTemperatureStart*/									6000,			// 80°C int16_t dischargeStopHighTemperatureStart; Abschalttemperatur Entladung wegen zu hoher Temperatur
 	/* dischargeStopHighTemperatureStop	*/									5500,			// 75°C int16_t dischargeStopHighTemperatureStop; Wiedereinschalttemperatur
@@ -256,5 +284,13 @@
 	/* uBatEmptyCompStartTemp	*/											50,				// 5°C We start calculating uBatEmpty compensations only when cell temperature is lower than this value
 	/* uBatEmptyCompStopTemp	*/											-200,			// -20°C We stop calculating uBatEmpty compensations when cell temperature is lower than this value
+#if defined SYSTEM_VOLTAGE_12V
 	/* uBatEmptyCompStopVolt	*/											10000,			// 10V uBatEmpty voltage at temperatures lower than -20°C
+#elif defined SYSTEM_VOLTAGE_24V
+/* uBatEmptyCompStopVolt	*/												20000,			// 10V uBatEmpty voltage at temperatures lower than -20°C
+#elif defined SYSTEM_VOLTAGE_48V
+/* uBatEmptyCompStopVolt	*/												40000,			// 10V uBatEmpty voltage at temperatures lower than -20°C
+#else
+  #error "System voltage not defined"
+#endif
 
 	/* extraDischargeStrom_mA	*/											7,				// mA, current that LiPro consumes itself
@@ -262,5 +298,13 @@
 	/* Battery Empty Detection Mode*/										1,				// Auto, from BMS
 	/* AUX MODE */															AUX_MODE_HEATER,// Heizung
+#if defined SYSTEM_VOLTAGE_12V
 	/* AUX SETPOINT ON */													13600,			// Erkennung Ladegerät ab 13,6V
+#elif defined SYSTEM_VOLTAGE_24V
+	/* AUX SETPOINT ON */													27200,			// Erkennung Ladegerät ab 13,6V
+#elif defined SYSTEM_VOLTAGE_48V
+	/* AUX SETPOINT ON */													54400,			// Erkennung Ladegerät ab 13,6V
+#else
+#error No valid device type
+#endif
 	/* AUX SETPOINT OFF */													100,			// Batterie Entladung wird erkannt bei -100mA
 	/* AUX Inverted */														0,				// Nicht invertiert
Index: trunk/fw_g473rct/SES/src/esr.c
===================================================================
--- trunk/fw_g473rct/SES/src/esr.c	(revision 37)
+++ trunk/fw_g473rct/SES/src/esr.c	(revision 38)
@@ -12,6 +12,5 @@
 int32_t current_buffer[SAMPLE_ARRAY_SIZE];  
 int32_t voltage_buffer[SAMPLE_ARRAY_SIZE];
-//int32_t current_buffer_fast[SAMPLE_ARRAY_SIZE];  
-//int32_t voltage_buffer_fast[SAMPLE_ARRAY_SIZE];
+
 
 extern uint16_t adc12Data[SAMPLE_ARRAY_SIZE][2];
Index: trunk/fw_g473rct/SES/src/outputs.c
===================================================================
--- trunk/fw_g473rct/SES/src/outputs.c	(revision 37)
+++ trunk/fw_g473rct/SES/src/outputs.c	(revision 38)
@@ -118,5 +118,5 @@
 			//Temperabschaltung Start 80°C
 			//Temperaturabschaltung Stop -99°C
-			if (sys_data.s.values.lvpState != OUTPUTS_LVP_OVERCURRENT)
+			if ((sys_data.s.values.lvpState != OUTPUTS_LVP_OVERCURRENT) && (sys_data.s.values.lvpState != OUTPUTS_LVP_SHORT_PROTECTION))
 			{
 				//Andere Fehler, automatisches zurücksetzen, wenn keine Fehlerbedingungen mehr vorliegen
@@ -209,5 +209,5 @@
 			//Wenn Abschaltung aufgrund zu hohem Lade/Lastrom erfolgt ist, dann muss Rücksetzen durch Reset Button erfolgen 
 			//Andere Fehler, automatisches zurücksetzen, wenn keine Fehlerbedingungen mehr vorliegen
-			if (sys_data.s.values.ovpState != OUTPUTS_OVP_OVERCURRENT)
+			if ((sys_data.s.values.ovpState != OUTPUTS_OVP_OVERCURRENT) && (sys_data.s.values.ovpState != OUTPUTS_OVP_SHORT_PROTECTION) )
 			{
 				printf("OUTPUT OVP OK\n");
Index: trunk/fw_g473rct/SES/src/shunt_voltage.c
===================================================================
--- trunk/fw_g473rct/SES/src/shunt_voltage.c	(revision 37)
+++ trunk/fw_g473rct/SES/src/shunt_voltage.c	(revision 38)
@@ -19,5 +19,17 @@
 #define ADC_RESOLUTION						  32768 //65536/2 da im differential mode
 #define ADC_OFFSET							  32768
-#define SHUNT_VOLTAGE_DIVIDER				  6
+
+#if defined SYSTEM_VOLTAGE_12V
+  #define SHUNT_VOLTAGE_DIVIDER       6.0
+#elif defined SYSTEM_VOLTAGE_24V
+  #define SHUNT_VOLTAGE_DIVIDER       11.0
+#elif defined SYSTEM_VOLTAGE_48V
+  #define SHUNT_VOLTAGE_DIVIDER       21.0
+#else
+  #error "System voltage not defined"
+#endif
+
+
+
 //	--- LOKALE TYPE DEFS - bitte hier dokumentieren-------------------------------
 
