Index: trunk/fw_g473rct/SES/inc/ads1260.h
===================================================================
--- trunk/fw_g473rct/SES/inc/ads1260.h	(revision 71)
+++ trunk/fw_g473rct/SES/inc/ads1260.h	(revision 73)
@@ -137,3 +137,5 @@
 void ADS_1260_SetDataRate(SPI_HandleTypeDef * hspi, uint8_t dataRate);
 
+void ADS1260_BatteryVoltageZeroCal(void);
+void ADS1260_ShuntVoltageZeroCal(void);
 #endif // !_ADS_1260_H
Index: trunk/fw_g473rct/SES/inc/battery_voltage.h
===================================================================
--- trunk/fw_g473rct/SES/inc/battery_voltage.h	(revision 71)
+++ 	(revision )
@@ -1,39 +1,0 @@
-/******************************************************************************
-*
-* @file    battery_voltage.h
-* @author  ECS, Falko Jahn
-* @version V1.0.0
-* @date    2020-05-01
-* @brief       
-*
-******************************************************************************/
-#ifndef __BATTERY_VOLTAGE_H
-#define __BATTERY_VOLTAGE_H
-
-//--- INCLUDEs -----------------------------------------------------------------
-#include "main.h"
-//--- GLOBALE TYPE DEFS --------------------------------------------------------       
-
-//--- GLOBALE DEFINES ----------------------------------------------------------
-#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
-
-//--- GLOBALE VARIABLEN PROTOTYPEN ---------------------------------------------
-
-//--- GLOBALE FUNKTIONS PROTOTYPEN ---------------------------------------------
-void BATTERY_VOLTAGE_Exec(int32_t newvalP );
-void BATTERY_VOLTAGE_ZeroCal(void);
-
-#endif //
Index: trunk/fw_g473rct/SES/inc/battery_voltage_fast.h
===================================================================
--- trunk/fw_g473rct/SES/inc/battery_voltage_fast.h	(revision 73)
+++ trunk/fw_g473rct/SES/inc/battery_voltage_fast.h	(revision 73)
@@ -0,0 +1,30 @@
+/******************************************************************************
+*
+* @file    battery_voltage.h
+* @author  ECS, Falko Jahn
+* @version V1.0.0
+* @date    2020-05-01
+* @brief       
+*
+******************************************************************************/
+#ifndef __BATTERY_VOLTAGE_H
+#define __BATTERY_VOLTAGE_H
+
+//--- INCLUDEs -----------------------------------------------------------------
+#include "main.h"
+//--- GLOBALE TYPE DEFS --------------------------------------------------------       
+
+//--- GLOBALE DEFINES ----------------------------------------------------------
+
+
+#define BATTERY_VOLTAGE_FAST_ADC_RESOLUTION		  65536 
+#define BATTERY_VOLTAGE_FAST_ADC_OFFSET			  32768
+
+//--- GLOBALE VARIABLEN PROTOTYPEN ---------------------------------------------
+
+//--- GLOBALE FUNKTIONS PROTOTYPEN ---------------------------------------------
+void BATTERY_VOLTAGE_FAST_Exec(int32_t newvalP );
+void BATTERY_VOLTAGE_FAST_ZeroCal(void);
+
+
+#endif //
Index: trunk/fw_g473rct/SES/inc/chip_temperature.h
===================================================================
--- trunk/fw_g473rct/SES/inc/chip_temperature.h	(revision 71)
+++ trunk/fw_g473rct/SES/inc/chip_temperature.h	(revision 73)
@@ -33,4 +33,4 @@
 * @retval	kein
 */
-void CHIP_TEMPERATURE_Exec(uint32_t chiptemperature);
+void CHIP_TEMPERATURE_Exec(int32_t chiptemperature);
 #endif // !__CHIP_TEMPERATURE_H
Index: trunk/fw_g473rct/SES/inc/esr.h
===================================================================
--- trunk/fw_g473rct/SES/inc/esr.h	(revision 71)
+++ trunk/fw_g473rct/SES/inc/esr.h	(revision 73)
@@ -1,4 +1,8 @@
+#ifndef __ESR_H
+#define __ESR_H
+
 #include <inttypes.h>
 
-int16_t ESR_Exec(void);
+
 int16_t ESR_FAST_Exec(void);
+#endif
Index: trunk/fw_g473rct/SES/inc/fast_current.h
===================================================================
--- trunk/fw_g473rct/SES/inc/fast_current.h	(revision 71)
+++ trunk/fw_g473rct/SES/inc/fast_current.h	(revision 73)
@@ -36,7 +36,7 @@
 
 //--- GLOBALE FUNKTIONS PROTOTYPEN ---------------------------------------------
-void FAST_CURRENT_Exec(uint32_t newVal );
-void CurrentOffsetCal(uint32_t newVal);
-void CurrentGainCal(uint32_t newVal);
+void FAST_CURRENT_Exec(int32_t newVal );
+void CurrentOffsetCal(int32_t newVal);
+void CurrentGainCal(int32_t newVal);
 
 #endif //
Index: trunk/fw_g473rct/SES/inc/int_bat_voltage.h
===================================================================
--- trunk/fw_g473rct/SES/inc/int_bat_voltage.h	(revision 71)
+++ trunk/fw_g473rct/SES/inc/int_bat_voltage.h	(revision 73)
@@ -12,5 +12,5 @@
 
 //--- INCLUDEs -----------------------------------------------------------------
-
+#include "inttypes.h"
 //--- GLOBALE TYPE DEFS --------------------------------------------------------       
 
@@ -26,5 +26,5 @@
 * @retval	kein
 */
-void INT_BAT_VOLTAGE_Exec(uint32_t newval);
+void INT_BAT_VOLTAGE_Exec(int32_t newval);
 
 #endif // __REF_VOLTAGE_H
Index: trunk/fw_g473rct/SES/inc/shunt_voltage.h
===================================================================
--- trunk/fw_g473rct/SES/inc/shunt_voltage.h	(revision 71)
+++ 	(revision )
@@ -1,30 +1,0 @@
-/******************************************************************************
-*
-* @file    shuntVoltage.h
-* @author  ECS, Joseph Zimmer
-* @version V1.0.0
-* @date    24-04-2019
-* @brief       
-*
-******************************************************************************/
-#ifndef __SHUNT_VOLTAGE_H
-#define __SHUNT_VOLTAGE_H
-
-//--- INCLUDEs -----------------------------------------------------------------
-#include "main.h"
-//--- GLOBALE TYPE DEFS --------------------------------------------------------       
-
-//--- GLOBALE DEFINES ----------------------------------------------------------
-
-//--- GLOBALE VARIABLEN PROTOTYPEN ---------------------------------------------
-
-//--- GLOBALE FUNKTIONS PROTOTYPEN ---------------------------------------------
-
-/*
-* @brief	
-* @param	kein
-* @retval	kein
-*/
-void SHUNT_VOLTAGE_Exec(int32_t voltage);
-
-#endif // !__SHUNT_VOLTAGE_H
Index: trunk/fw_g473rct/SES/inc/shunt_voltage_fast.h
===================================================================
--- trunk/fw_g473rct/SES/inc/shunt_voltage_fast.h	(revision 73)
+++ trunk/fw_g473rct/SES/inc/shunt_voltage_fast.h	(revision 73)
@@ -0,0 +1,30 @@
+/******************************************************************************
+*
+* @file    shuntVoltage.h
+* @author  ECS, Joseph Zimmer
+* @version V1.0.0
+* @date    24-04-2019
+* @brief       
+*
+******************************************************************************/
+#ifndef __SHUNT_VOLTAGE_H
+#define __SHUNT_VOLTAGE_H
+
+//--- INCLUDEs -----------------------------------------------------------------
+#include "main.h"
+//--- GLOBALE TYPE DEFS --------------------------------------------------------       
+
+//--- GLOBALE DEFINES ----------------------------------------------------------
+
+//--- GLOBALE VARIABLEN PROTOTYPEN ---------------------------------------------
+
+//--- GLOBALE FUNKTIONS PROTOTYPEN ---------------------------------------------
+
+/*
+* @brief	
+* @param	kein
+* @retval	kein
+*/
+void SHUNT_VOLTAGE_FAST_Exec(int32_t voltage);
+void SHUNT_VOLTAGE_FAST_ZeroCal(void);
+#endif // !__SHUNT_VOLTAGE_H
Index: trunk/fw_g473rct/SES/inc/sysdata.h
===================================================================
--- trunk/fw_g473rct/SES/inc/sysdata.h	(revision 71)
+++ trunk/fw_g473rct/SES/inc/sysdata.h	(revision 73)
@@ -127,5 +127,5 @@
 	int32_t batteryCurrentGainTemperatureCompensationShuntFactor;				// 82-83	Berechneter Faktor für Gain Temperatur kompensation. Pro 1/100 C * 1000000000
 	int16_t batteryCurrentGainTemperatureCalibrationChipTemperature;			// 84		Gesicherte Chip Temperatur bei Start der Gain Temperatur Kompensation
-	int16_t UNIQUE_NAME(reserved);												// 85		reserviert
+	int16_t shuntVoltageFastOffset;												// 85		reserviert
 	int32_t batteryCurrentGainTemperatureCompensationChipFactor;				// 86-87	zuszätzlicher Kalibrierungsfaktor, nicht in Verwendung
 	int32_t batteryCurrentOffsetFast;											// 88-89	Korrektur in STM32 ADC Messung Gain, Strommessung
@@ -136,5 +136,8 @@
 	uint16_t auxOutputSetpointOff;												// 95		SOC in Prozent für SOC mode
 	uint16_t auxOutputInverted;													// 96		0= NORMAL, 1=INVERTED
-	uint16_t UNIQUE_NAME(reserved)[3];
+	int16_t batteryVoltageFastOffset;											// 97		Offset für Spannungsmessung
+	int16_t batteryVoltageOffset;												// 98		Offset für Spannungsmessung
+	int16_t	shuntVoltageOffset;													// 99		Offset für Spannungsmessung
+	
 
 } device_parameter_t;
@@ -150,5 +153,5 @@
 	/* 2 of 8 */ int16_t  shuntTemperatureMax;									// 104		Höchste Shunttemperatur seit Programmstart, kann durch Schreiben von Int16-Min (-32.768) in das Register zurückgesetzt werden
 	/* 4 of 8 */ int16_t  shuntTemperatureMin;									// 105		Niedrigste Shunttemperatur seit Programmstart, kann durch Schreiben von  Int16_Max (+32.767) in das Register zurückgesetzt werden
-	/* 8 of 8 */ uint32_t shuntVoltage;											// 106-107	Shuntspannung in mV (Common Mode Voltage) gemessen von dem STM32G0. Spannung zwischen Shunt B und GND Versorgung
+	/* 8 of 8 */ int32_t  shuntVoltage;											// 106-107	Shuntspannung in mV (Common Mode Voltage) gemessen von dem STM32G0. Spannung zwischen Shunt B und GND Versorgung
 	/* 4 of 8 */ int32_t  batteryVoltage;										// 108-109!	Gemessenen Batteriespannung in mV. Es kann in beide Richtungen gemessen werden (mindestens von -60V bis +60V). Es muss darauf geachtet werden, dass die gemessen Spannung positiv ist (+ an Batterieplus und - an Batterieminus)
 	/* 8 of 8 */ int32_t  batteryVoltageMax;									// 110-111	Hchster Spannungswert in mV (Batteriespannung) seit Programmstart. Kann durch schreiben von int32-Min (-2,147,483,648) in das Register zurckgesetzt werden
@@ -170,7 +173,7 @@
 	/* 2 of 8 */ int16_t  selfDischarge;										// 140		[mA]
 	/* 4 of 8 */ int16_t  selfDischargeAvg;										// 141		[mA]
-	/* 6 of 8 */ int16_t  esr;													// 142		[mOhm]
-	/* 8 of 8 */ int16_t  esr_fast;												// 143		[mOhm]
-	/* 6 of 8 */ uint32_t lastTimeVbatFull;										// 144-145	[s]
+	/* 6 of 8 */ int16_t  esr_batt;												// 142		[mOhm]
+	/* 8 of 8 */ int16_t  esr_shunt;											// 143		[mOhm]
+	/* 4 of 8 */ uint32_t lastTimeVbatFull;										// 144-145	[s]
 	/* 8 of 8 */ uint32_t lastTimeVbatEmpty;									// 146-147	[s]
 	/* 4 of 8 */ uint32_t onTime;												// 148-149	[s] Runtime Zähler zum speichern der Statistik Werte im EEPROM und als Betriebszeitzähler
@@ -185,12 +188,12 @@
 	/* 8 of 8 */ int16_t  calculatedCEFWh;										// 163
 	/* 4 of 8 */ int32_t  mWh_AutoMode;											// 164-165
-	/* 2 of 8 */ int16_t  overcurrentMeasurement;								// 166
-	/* 4 of 8 */ int16_t  overcurrentMaxValue;									// 167 /reserviert
+	/* 6 of 8 */ int16_t  overcurrentMeasurement;								// 166
+	/* 8 of 8 */ int16_t  overcurrentMaxValue;									// 167 /reserviert
 	/* 2 of 8 */ uint16_t ovp_sense;                                            // 168 reserviert
 	/* 4 of 8 */ uint16_t lvp_sense;                                            // 169
 	/* 6 of 8 */ uint16_t overcurrentRetryCounter;								// 170
 	/* 8 of 8 */ uint16_t overcurrentEventsTotal;								// 171
-	/* 6 of 8 */ uint32_t detectedCapacityAtActualCRate;						// 272,273
-	/* 8 of 8 */ uint32_t detectedEnergyAtActualCRate;							// 274,275
+	/* 4 of 8 */ uint32_t detectedCapacityAtActualCRate;						// 172,173
+	/* 8 of 8 */ uint32_t detectedEnergyAtActualCRate;							// 174,175
 
 
@@ -207,13 +210,13 @@
 	/* 8 of 8 */ int32_t  batteryCurrentOffsetCommonModeCorrectionADCSteps;		// 198-199	Offset Korrektur Wert aufgrund Common Mode Error
 	/* 4 of 8 */ int32_t  fast_current;											// 200-201
-	/* 4 of 8 */ int32_t  fast_voltage;											// 202-203
-	/* 8 of 8 */ int16_t  esrCalcStatus;										// 204
-	/* 2 of 8 */ uint16_t esrCalcTime;											// 205
-	/* 4 of 8 */ int16_t  selfDischargeStatus;									// 206
-	/* 6 of 8 */ uint16_t selfDischargeTime;									// 207
+	/* 8 of 8 */ int32_t  batteryVoltageFast;									// 202-203
+	/* 2 of 8 */ int16_t  esrCalcStatus;										// 204
+	/* 4 of 8 */ uint16_t esrCalcTime;											// 205
+	/* 6 of 8 */ int16_t  selfDischargeStatus;									// 206
+	/* 8 of 8 */ uint16_t selfDischargeTime;									// 207
 	/* 8 of 8 */ uint8_t  message[24];											// 208-219	ASCII-char message, limited to 20 letters
 	/* 8 of 8 */ int64_t  mWsCounterUncorrected;								// 220-223	[mWs]
 	/* 8 of 8 */ int64_t  mAsCounterUncorrected;								// 224-227	[mAs]
-	/* 2 of 8 */ int32_t  mAhCounterUncorrected;								// 228-229
+	/* 4 of 8 */ int32_t  mAhCounterUncorrected;								// 228-229
 	/* 6 of 8 */ uint16_t soc0;													// 230
 	/* 8 of 8 */ uint16_t soc1;													// 231
@@ -225,15 +228,24 @@
 	/* 6 of 8 */ uint16_t ltc_charge_current;									// 238
 	/* 8 of 8 */ uint16_t ltc_charge_current_max;								// 239
-	/* 4 of 8 */ int64_t  mAs_AutoModeU;										// 240-243
-	/* 6 of 8 */ uint16_t ramCRCErrCnt;											// 244
-	/* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 245
-	/* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 246
-	/* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 247
-	/* 6 of 8 */ uint16_t ltc_discharge_current;								// 248
-	/* 8 of 8 */ uint16_t ltc_discharge_current_max;							// 249
-	/* 8 of 8 */ int16_t  current_buffer[SAMPLE_ARRAY_SIZE];					// 250-313
-	/* 8 of 8 */ int16_t  voltage_buffer[SAMPLE_ARRAY_SIZE];					// 314-377
-	/* 8 of 8 */ int16_t  current_buffer_fast[SAMPLE_ARRAY_SIZE];				// 378-441
-	/* 8 of 8 */ int16_t  voltage_buffer_fast[SAMPLE_ARRAY_SIZE];				// 442-505
+	/* 8 of 8 */ int64_t  mAs_AutoModeU;										// 240-243
+	/* 2 of 8 */ uint16_t ramCRCErrCnt;											// 244
+	/* 4 of 8 */ int16_t  UNIQUE_NAME(reserved);									// 245
+	
+	/* 8 of 8 */ int32_t shuntVoltageFast;								// 246
+	/* 2 of 8 */ uint16_t ltc_discharge_current;								// 248
+	/* 4 of 8 */ uint16_t ltc_discharge_current_max;							// 249
+	/* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 250
+	/* 8 of 8 */ int16_t pos_I_peak;											// 251
+	/* 2 of 8 */ int16_t neg_I_peak;											// 252
+	/* 4 of 8 */ int16_t pos_U_Batt_peak;										// 253
+	/* 6 of 8 */ int16_t neg_U_Batt_peak;										// 254
+	/* 8 of 8 */ int16_t pos_U_Shunt_peak;										// 255
+	/* 2 of 8 */ int16_t neg_U_Shunt_peak;										// 256
+	/* 4 of 8 */ uint16_t pos_I_Buffer_pos;										// 257
+	/* 6 of 8 */ uint16_t neg_I_Buffer_pos;										// 258
+	/* 8 of 8 */ uint16_t UNIQUE_NAME(reserved);								// 259
+	/* 8 of 8 */ int16_t  current_buffer[SAMPLE_ARRAY_SIZE];					// 260-323
+	/* 8 of 8 */ int16_t  voltage_buffer_batt[SAMPLE_ARRAY_SIZE];				// 324-387
+	/* 8 of 8 */ int16_t  voltage_buffer_shunt[SAMPLE_ARRAY_SIZE];				// 388-451
 
 } device_values_t;
