This commit is contained in:
YiChin
2020-02-18 18:38:50 +08:00
parent d86b008bb1
commit 7e9dfbc4c2
2 changed files with 10 additions and 8 deletions
@@ -1296,9 +1296,9 @@ static int32_t DAC_to_realV(uint16_t DACcode)
usercode_32 = ((DACcode * 1e7) - Correction.Usercode2DAC.offset) / Correction.Usercode2DAC.coeff;
// RealV = (int32_t) (usercode_32 / 5) - 5000;
RealV = (int32_t) usercode_32;
// return mV
RealV = (int32_t) ((usercode_32 / 5) - 5000) * 1000;
// RealV = (int32_t) usercode_32;
// return nV
return RealV;
}
@@ -41,7 +41,7 @@ static uint16_t OneWayVoltScan(IVMode *IV) {
}
if (CT.StepTimeCounter == IV->_StepTime){
if (IV->_VOrigin < IV->_VStop) {
if (IV->_VOrigin < IV->_VStop) {//4~5V
// output the next output volt
INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + IV->_Step;
// Only used in two-wire IV
@@ -99,10 +99,12 @@ static uint16_t OneWayVoltScan(IVMode *IV) {
NotifyVolt[2] = (uint8_t)((RealV & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t)(RealV & 0x000000FF);
NotifyImpedance[0] = (uint8_t)((RealV & 0xFF000000) >> 24);
NotifyImpedance[1] = (uint8_t)((RealV & 0x00FF0000) >> 16);
NotifyImpedance[2] = (uint8_t)((RealV & 0x0000FF00) >> 8);
NotifyImpedance[3] = (uint8_t)(RealV & 0x000000FF);
NotifyImpedance[0] = 0x00;
NotifyImpedance[1] = 0x00;
NotifyImpedance[2] = (uint8_t)((INSTRUCTION.VoltConstant & 0xFF00) >> 8);
NotifyImpedance[3] = (uint8_t)(INSTRUCTION.VoltConstant & 0x00FF);
}