aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-05-27 14:05:27 +0300
committerAvi Levkovich <avi@twine-s.com>2020-05-27 14:05:27 +0300
commitcbde63d915eeebcd7ba8e9786269ba6545c41bde (patch)
tree134ce99fdcff2d3d2f79c60a749c5c72bef7132e /Software/Embedded_SW
parentfd326204404ee0932ea465efcdd41e21fd7f2b49 (diff)
downloadTango-cbde63d915eeebcd7ba8e9786269ba6545c41bde.tar.gz
Tango-cbde63d915eeebcd7ba8e9786269ba6545c41bde.zip
Add support for Head Staple spun pressure sensors - orf
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c12
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.c105
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c1
4 files changed, 79 insertions, 41 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c
index 306e6e6f8..ca2b24eae 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c
@@ -456,7 +456,17 @@ uint32_t CalculateTemperatures(TEMPERATURE_SENSOR_ID_ENUM SensorId, uint32_t Dat
uint32_t NoOfAvrSamples = 5;//TODO - how many Samples
Status = Filter_Temparature_Measurement(SensorId, Current_Measurement_C, NoOfAvrSamples);
#else
- TempSensorResponse[SensorId].Temperature_C_mult_by_100 = Current_Measurement_C;
+ if((Head_Type == HEAD_TYPE_STAPLE_SPUN) && (( SensorId == HEAD_PT100_ZONE_6_0X84_1) || ( SensorId == HEAD_PT100_ZONE_8_0X86_1)))//pressure sensors
+ //if((Head_Type == HEAD_TYPE_STAPLE_SPUN) && (( SensorId == HEAD_PT100_ZONE_5_0X84_0) || ( SensorId == HEAD_PT100_ZONE_7_0X86_0)))//pressure sensors
+ {
+ //Head Staple spun pressure sensors
+ TempSensorResponse[SensorId].Temperature_C_mult_by_100 = TempSensorResponse[SensorId].PT100_ADC_Reading_Bits;
+ Current_Measurement_C = TempSensorResponse[SensorId].PT100_ADC_Reading_Bits;
+ }
+ else
+ {
+ TempSensorResponse[SensorId].Temperature_C_mult_by_100 = Current_Measurement_C;
+ }
#endif
return Current_Measurement_C;
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.c
index ec798b472..a6db745cd 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.c
@@ -252,43 +252,72 @@ uint8_t HeadADCPT100_InitConfigReg()
{
for(i=HEAD_PT100_ZONE_1_0X80_0;i < MAX_HEAD_CARD_TEMP_SENS_ID;i++) // for now we are using the same configuration to all of them
{
- // - - - - - - - - - - Reg0 - - - - - - - - - -
- HeadTempSensConfig[i].Reg0.bits.PGA_BYPASS = ADS122X_USE_PGA ;//Bit 0
- HeadTempSensConfig[i].Reg0.bits.GAIN = ADS122X_GAIN_8 ;//Bits 1-3
- //HeadTempSensConfig[i].Reg0.bits.MUX = HEAD_CONFIG_ODD_PT100_MUX ;//Bits 4-7
+ if((Head_Type == HEAD_TYPE_STAPLE_SPUN) && (( i == HEAD_PT100_ZONE_6_0X84_1) || ( i == HEAD_PT100_ZONE_8_0X86_1)))//pressure sensors
+ //if((Head_Type == HEAD_TYPE_STAPLE_SPUN) && (( i == HEAD_PT100_ZONE_5_0X84_0) || ( i == HEAD_PT100_ZONE_7_0X86_0)))//pressure sensors
+ {
+ // - - - - - - - - - - Reg0 - - - - - - - - - -
+ HeadTempSensConfig[i].Reg0.bits.PGA_BYPASS = ADS122X_PGA_BYPASS ;//Bit 0
+ HeadTempSensConfig[i].Reg0.bits.GAIN = ADS122X_GAIN_1 ;//Bits 1-3
+ //HeadTempSensConfig[i].Reg0.bits.MUX = HEAD_CONFIG_ODD_PT100_MUX ;//Bits 4-7
- // - - - - - - - - - - Reg1 - - - - - - - - - -
+ // - - - - - - - - - - Reg1 - - - - - - - - - -
+ HeadTempSensConfig[i].Reg1.bits.TS = ADS122X_TEMP_SENSOR_OFF ;//Bit 0
+ HeadTempSensConfig[i].Reg1.bits.VREF = ADS122X_VREF_AVDD ;//Bits 1-2
+ HeadTempSensConfig[i].Reg1.bits.CM = ADS122X_CONVERSION_CONTINUOUS ;//Bit 3
+ HeadTempSensConfig[i].Reg1.bits.MODE = ADS122X_OP_MODE_NORMAL ;//Bit 4
+ HeadTempSensConfig[i].Reg1.bits.DR = ADS122X_DATA_RATE_20SPS ;//Bits 5-7
- HeadTempSensConfig[i].Reg1.bits.TS = ADS122X_TEMP_SENSOR_OFF ;//Bit 0
- HeadTempSensConfig[i].Reg1.bits.VREF = ADS122X_VREF_EXT_REF0_PINS ;//Bits 1-2
- HeadTempSensConfig[i].Reg1.bits.CM = ADS122X_CONVERSION_CONTINUOUS ;//Bit 3
- HeadTempSensConfig[i].Reg1.bits.MODE = ADS122X_OP_MODE_NORMAL ;//Bit 4
- HeadTempSensConfig[i].Reg1.bits.DR = ADS122X_DATA_RATE_20SPS ;//Bits 5-7
+ // - - - - - - - - - - Reg2 - - - - - - - - - -
+ HeadTempSensConfig[i].Reg2.bits.IDAC = ADS122X_IDAC_CURRENT_OFF ;//Bits 0-2
+ HeadTempSensConfig[i].Reg2.bits.BCS = ADS122X_BCS_CURRENT_SOURCES_OFF ;//Bit 3
+ HeadTempSensConfig[i].Reg2.bits.CRC = ADS122X_CRC_DISABLED ;//BitS 4-5
+ HeadTempSensConfig[i].Reg2.bits.DCNT = ADS122X_DCNT_CONVERSION_COUNTER_DISABLED ;//Bit 6
+ HeadTempSensConfig[i].Reg2.bits.DRDY = ADS122X_DRDY_NO_NEW_CONVERSION ;//Bit 7
- // - - - - - - - - - - Reg2 - - - - - - - - - -
+ // - - - - - - - - - - Reg3 - - - - - - - - - -
+ HeadTempSensConfig[i].Reg3.bits.Always_write_0 = ADS122X_RESERVED_WRITE_0 ;//BitS 0-1 Always write 0
+ HeadTempSensConfig[i].Reg3.bits.I2MUX = ADS122X_IDAC2_DISABLED ;//Bits 2-4
+ HeadTempSensConfig[i].Reg3.bits.I1MUX = ADS122X_IDAC1_DISABLED ;//Bits 5-7
+ }
+ else
+ {
+ // - - - - - - - - - - Reg0 - - - - - - - - - -
+ HeadTempSensConfig[i].Reg0.bits.PGA_BYPASS = ADS122X_USE_PGA ;//Bit 0
+ HeadTempSensConfig[i].Reg0.bits.GAIN = ADS122X_GAIN_8 ;//Bits 1-3
+ //HeadTempSensConfig[i].Reg0.bits.MUX = HEAD_CONFIG_ODD_PT100_MUX ;//Bits 4-7
- HeadTempSensConfig[i].Reg2.bits.IDAC = ADS122X_IDAC_CURRENT_1000_UA ;//Bits 0-2
- HeadTempSensConfig[i].Reg2.bits.BCS = ADS122X_BCS_CURRENT_SOURCES_OFF ;//Bit 3
- HeadTempSensConfig[i].Reg2.bits.CRC = ADS122X_CRC_DISABLED ;//BitS 4-5
- HeadTempSensConfig[i].Reg2.bits.DCNT = ADS122X_DCNT_CONVERSION_COUNTER_DISABLED ;//Bit 6
- HeadTempSensConfig[i].Reg2.bits.DRDY = ADS122X_DRDY_NO_NEW_CONVERSION ;//Bit 7
+ // - - - - - - - - - - Reg1 - - - - - - - - - -
+ HeadTempSensConfig[i].Reg1.bits.TS = ADS122X_TEMP_SENSOR_OFF ;//Bit 0
+ HeadTempSensConfig[i].Reg1.bits.VREF = ADS122X_VREF_EXT_REF0_PINS ;//Bits 1-2
+ HeadTempSensConfig[i].Reg1.bits.CM = ADS122X_CONVERSION_CONTINUOUS ;//Bit 3
+ HeadTempSensConfig[i].Reg1.bits.MODE = ADS122X_OP_MODE_NORMAL ;//Bit 4
+ HeadTempSensConfig[i].Reg1.bits.DR = ADS122X_DATA_RATE_20SPS ;//Bits 5-7
+
+ // - - - - - - - - - - Reg2 - - - - - - - - - -
+ HeadTempSensConfig[i].Reg2.bits.IDAC = ADS122X_IDAC_CURRENT_1000_UA ;//Bits 0-2
+ HeadTempSensConfig[i].Reg2.bits.BCS = ADS122X_BCS_CURRENT_SOURCES_OFF ;//Bit 3
+ HeadTempSensConfig[i].Reg2.bits.CRC = ADS122X_CRC_DISABLED ;//BitS 4-5
+ HeadTempSensConfig[i].Reg2.bits.DCNT = ADS122X_DCNT_CONVERSION_COUNTER_DISABLED ;//Bit 6
+ HeadTempSensConfig[i].Reg2.bits.DRDY = ADS122X_DRDY_NO_NEW_CONVERSION ;//Bit 7
+
+ // - - - - - - - - - - Reg3 - - - - - - - - - -
+ HeadTempSensConfig[i].Reg3.bits.Always_write_0 = ADS122X_RESERVED_WRITE_0 ;//BitS 0-1 Always write 0
+ HeadTempSensConfig[i].Reg3.bits.I2MUX = ADS122X_IDAC2_AIN3 ;//Bits 2-4
+ HeadTempSensConfig[i].Reg3.bits.I1MUX = ADS122X_IDAC1_AIN0 ;//Bits 5-7
+ }
- // - - - - - - - - - - Reg3 - - - - - - - - - -
- HeadTempSensConfig[i].Reg3.bits.Always_write_0 = ADS122X_RESERVED_WRITE_0 ;//BitS 0-1 Always write 0
- HeadTempSensConfig[i].Reg3.bits.I2MUX = ADS122X_IDAC2_AIN3 ;//Bits 2-4
- HeadTempSensConfig[i].Reg3.bits.I1MUX = ADS122X_IDAC1_AIN0 ;//Bits 5-7
}
for(i=HEAD_PT100_ZONE_1_0X80_0;i < HEAD_PT100_ZONE_2_0X80_1;i++)
{
- HeadTempSensConfig[i].Reg0.bits.MUX = HEAD_CONFIG_ODD_PT100_MUX ;//Bits 4-7
+ HeadTempSensConfig[i].Reg0.bits.MUX = HEAD_CONFIG_ODD_PT100_MUX ;//Bits 4-7
HeadTempSensConfig[i].SEL = HEAD_CONFIG_ODD_PT100_PT_SEL;
}
for(i=HEAD_PT100_ZONE_2_0X80_1;i < HEAD_PT100_RESERVE_0X8E_1;i++)
{
- HeadTempSensConfig[i].Reg0.bits.MUX = HEAD_CONFIG_EVEN_PT100_MUX ;//Bits 4-7
+ HeadTempSensConfig[i].Reg0.bits.MUX = HEAD_CONFIG_EVEN_PT100_MUX ;//Bits 4-7
HeadTempSensConfig[i].SEL = HEAD_CONFIG_EVEN_PT100_PT_SEL;
}
@@ -303,30 +332,30 @@ uint8_t HeadADCPT100_InitConfigReg()
for(i=HEAD_PT100_ZONE_1_0X80_0;i<MAX_HEAD_CARD_TEMP_SENS_ID; i++)
{
// - - - - - - - - - - Reg0 - - - - - - - - - -
- HeadTempSensConfig[i].Reg0.bits.PGA_BYPASS = ADS122X_USE_PGA ;//Bit 0
- HeadTempSensConfig[i].Reg0.bits.GAIN = ADS122X_GAIN_8 ;//Bits 1-3
- HeadTempSensConfig[i].Reg0.bits.MUX = ADS122X_MUX_AIN1_AIN0 ;//Bits 4-7
+ HeadTempSensConfig[i].Reg0.bits.PGA_BYPASS = ADS122X_USE_PGA ;//Bit 0
+ HeadTempSensConfig[i].Reg0.bits.GAIN = ADS122X_GAIN_8 ;//Bits 1-3
+ HeadTempSensConfig[i].Reg0.bits.MUX = ADS122X_MUX_AIN1_AIN0 ;//Bits 4-7
// - - - - - - - - - - Reg1 - - - - - - - - - -
- HeadTempSensConfig[i].Reg1.bits.TS = ADS122X_TEMP_SENSOR_OFF ;//Bit 0
- HeadTempSensConfig[i].Reg1.bits.VREF = ADS122X_VREF_INTERNAL ;//Bits 1-2
- HeadTempSensConfig[i].Reg1.bits.CM = ADS122X_CONVERSION_CONTINUOUS ;//Bit 3
- HeadTempSensConfig[i].Reg1.bits.MODE = ADS122X_OP_MODE_NORMAL ;//Bit 4
- HeadTempSensConfig[i].Reg1.bits.DR = ADS122X_DATA_RATE_20SPS ;//Bits 5-7
+ HeadTempSensConfig[i].Reg1.bits.TS = ADS122X_TEMP_SENSOR_OFF ;//Bit 0
+ HeadTempSensConfig[i].Reg1.bits.VREF = ADS122X_VREF_INTERNAL ;//Bits 1-2
+ HeadTempSensConfig[i].Reg1.bits.CM = ADS122X_CONVERSION_CONTINUOUS ;//Bit 3
+ HeadTempSensConfig[i].Reg1.bits.MODE = ADS122X_OP_MODE_NORMAL ;//Bit 4
+ HeadTempSensConfig[i].Reg1.bits.DR = ADS122X_DATA_RATE_20SPS ;//Bits 5-7
// - - - - - - - - - - Reg2 - - - - - - - - - -
- HeadTempSensConfig[i].Reg2.bits.IDAC = ADS122X_IDAC_CURRENT_500_UA ;//Bits 0-2
- HeadTempSensConfig[i].Reg2.bits.BCS = ADS122X_BCS_CURRENT_SOURCES_OFF ;//Bit 3
- HeadTempSensConfig[i].Reg2.bits.CRC = ADS122X_CRC_DISABLED ;//BitS 4-5
- HeadTempSensConfig[i].Reg2.bits.DCNT = ADS122X_DCNT_CONVERSION_COUNTER_DISABLED ;//Bit 6
- HeadTempSensConfig[i].Reg2.bits.DRDY = ADS122X_DRDY_NO_NEW_CONVERSION ;//Bit 7
+ HeadTempSensConfig[i].Reg2.bits.IDAC = ADS122X_IDAC_CURRENT_500_UA ;//Bits 0-2
+ HeadTempSensConfig[i].Reg2.bits.BCS = ADS122X_BCS_CURRENT_SOURCES_OFF ;//Bit 3
+ HeadTempSensConfig[i].Reg2.bits.CRC = ADS122X_CRC_DISABLED ;//BitS 4-5
+ HeadTempSensConfig[i].Reg2.bits.DCNT = ADS122X_DCNT_CONVERSION_COUNTER_DISABLED ;//Bit 6
+ HeadTempSensConfig[i].Reg2.bits.DRDY = ADS122X_DRDY_NO_NEW_CONVERSION ;//Bit 7
// - - - - - - - - - - Reg3 - - - - - - - - - -
- HeadTempSensConfig[i].Reg3.bits.Always_write_0 = ADS122X_RESERVED_WRITE_0 ;//BitS 0-1 Always write 0
- HeadTempSensConfig[i].Reg3.bits.I2MUX = ADS122X_IDAC2_DISABLED ;//Bits 2-4
- HeadTempSensConfig[i].Reg3.bits.I1MUX = ADS122X_IDAC1_AIN3 ;//Bits 5-7
+ HeadTempSensConfig[i].Reg3.bits.Always_write_0 = ADS122X_RESERVED_WRITE_0 ;//BitS 0-1 Always write 0
+ HeadTempSensConfig[i].Reg3.bits.I2MUX = ADS122X_IDAC2_DISABLED ;//Bits 2-4
+ HeadTempSensConfig[i].Reg3.bits.I1MUX = ADS122X_IDAC1_AIN3 ;//Bits 5-7
}
}
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
index 25336f50c..9335a6d08 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
@@ -52,7 +52,5 @@ void MillisecLogClose(void);
extern bool watchdogCriticalAlarm;
-extern uint32_t Millisec_timerBase;
-
extern Task_Handle Millisecond_Task_Handle;
#endif /* MODULES_CONTROL_MILLISECTASK_H_ */
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
index 30067afa9..501899d7e 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
@@ -87,6 +87,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer)
}
else
if(request->amount == 0xdace)//test_dancer_responce_RTFU
+ //in order to use it unmark the define test_RTFU_dancer !!!!!!!!!!!
{
test_dancer_flag = true;