Compare commits

...

1 Commits

Author SHA1 Message Date
Benny Liu 440158f806 calibration mode 2019-10-01 18:46:51 +08:00
2 changed files with 59 additions and 4 deletions
@@ -29,7 +29,7 @@
*/
#define BOARD_BAY_BAY
#define BOARD_GENIUS
typedef struct _formula{
@@ -199,7 +199,7 @@ struct _correction{
#endif
#ifdef BOARD_BAY_BAY
#ifdef BOARD_GENIUS
{
.ADC_volt.coeff = (-6236652),
.ADC_volt.offset = 101533279052,
@@ -283,6 +283,61 @@ struct _correction{
};
#endif
#ifdef BOARD_BAY_BAY
{
.ADC_volt.coeff = (-6279056),
.ADC_volt.offset = 150985844279,
.ADC_current[0].coeff = 31788227 ,
.ADC_current[0].offset = (-765340735866),
.ADC_current[1].coeff = 657619858,
.ADC_current[1].offset = (-15835988865283),
.ADC_current[2].coeff = 31116362,
.ADC_current[2].offset = (-749402214847),
.DAC2RealV.coeff = (-18935149),
.DAC2RealV.offset = 643063752893,
.Usercode2DAC.coeff = (-10567567),
.Usercode2DAC.offset = 603991718526,
.Gain0Boundary[0] = 0x5DE5,
.Gain0Boundary[1] = 0x5E30,
.Gain1Boundary[0] = 0x5820,
.Gain1Boundary[1] = 0x6408
};
#endif
#ifdef BOARD_KELLY
{
.ADC_volt.coeff = (-6279056),
.ADC_volt.offset = 150985844279,
.ADC_current[0].coeff = 31788227 ,
.ADC_current[0].offset = (-765340735866),
.ADC_current[1].coeff = 657619858,
.ADC_current[1].offset = (-15835988865283),
.ADC_current[2].coeff = 31116362,
.ADC_current[2].offset = (-749402214847),
.DAC2RealV.coeff = (-18935149),
.DAC2RealV.offset = 643063752893,
.Usercode2DAC.coeff = (-10567567),
.Usercode2DAC.offset = 603991718526,
.Gain0Boundary[0] = 0x5DE5,
.Gain0Boundary[1] = 0x5E30,
.Gain1Boundary[0] = 0x5820,
.Gain1Boundary[1] = 0x6408
};
#endif
// this function turn ADC measure value (0xXXXX) into real voltage
// unit should be mV
@@ -834,8 +834,8 @@ static void update_ZM_instruction(uint8 *ins) {
case VOLT_OUTPUT: {
INSTRUCTION.eliteFxn = VOLT_OUTPUT;
INSTRUCTION.VoltConstant = ( ((uint16_t)(ins[3])) << 8) | (uint16_t)(ins[4]);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
// DAC_outputV(INSTRUCTION.VoltConstant);
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
DAC_outputV(INSTRUCTION.VoltConstant);
break;
}