diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDAC.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDAC.h index 2c7b9349f..75ce90395 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDAC.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDAC.h @@ -85,7 +85,7 @@ static int32_t DAC_to_realV(uint16_t DACcode) volt_32 = DACcode; // RealV = (volt_32 - offset) / coeff; RealV = (-1896) * volt_32 + offset; - RealV = RealV / 10e4; //(mV) + RealV = RealV / 10e3; //(mV) return RealV; } diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h index d4976a9ed..ff80c1e47 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h @@ -945,18 +945,21 @@ static void SendNotify(){ SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf); } -// "va": "(VOLT_ORIGIN + 1) * 0x0010", -// "vb": "(VOLT_FINAL + 1) * 0x0010", -// +// Old DAC output form +// Vorigin & Vfinal range : 0~49 +// "va": "(VOLT_ORIGIN + 1) * 0x0010", +// "vb": "(VOLT_FINAL + 1) * 0x0010", static uint16_t OldDAC2UserCode(uint16_t OldDAC){ uint16_t UserCode = 0; UserCode = (OldDAC / 0x0010) *1000; return UserCode; } +// Old step output form +// VOLT_STEP * 0x40 static uint8_t OldStep2NewStep(uint8_t OldStep){ uint8_t NewStep = 0; - NewStep = (OldStep / 0x12) * 0x9E; + NewStep = (OldStep / 0x40) * 0x9E; return NewStep; } @@ -965,13 +968,17 @@ static uint8_t OldStep2NewStepTime(uint8_t StepTime){ case 0:{ return 0x02; } - case 1:{ + case 0x12:{ return 0x05; } - case 2:{ + + // 0x12 * 2 = + case 0x24 :{ return 0x06; } - case 3:{ + + // 0x12 *3 + case 0x36 :{ return 0x09; } default:{