diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h index ac91e20..616015f 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h @@ -718,8 +718,8 @@ static int32_t read_LPTIA_Iin(){ // Iin = rawIin / 0.102; } // InputNotify(NOTIFY_VOLT, dftdat); - InputNotify(NOTIFY_CURRENT, Iin); - InputNotify(NOTIFY_IMPEDANCE, instru.ADCGainLv); + // InputNotify(NOTIFY_CURRENT, Iin); + // InputNotify(NOTIFY_IMPEDANCE, instru.ADCGainLv); return Iin; } 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 d44634b..798cbf3 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 @@ -21,18 +21,25 @@ static int32_t DAC_outputV(int32_t voltLVraw) { // LPDAC output, voltLV = Vbia int32_t ret; int32_t vscan; int64_t v_z; - int64_t v_zero; + static int64_t v_zero; int64_t v_bias; - uint8_t n_zero;//6btit + static uint8_t n_zero;//6btit uint16_t n_bias;//12bit uint32_t DACOutCode; vscan = voltLVraw; + static bool n_zero_temp = true; + v_z = (V_5nV(2200) - (int64_t)vscan) * 200000 / 431579 + V_5nV(200); // v_z = (V_5nV(2200) - vscan)/2.157895 + V_5nV(200); - n_zero = v_z * 100 / V_5nV(3438); // n_zero = v_z / V_5nV(34.38); - v_zero = (int64_t)n_zero * V_5nV(3438) / 100; // v_zero = n_zero * V_5nV(34.38); - // + if (n_zero_temp) { + n_zero_temp = false; + n_zero = v_z * 100 / V_5nV(3438); + v_zero = (int64_t)n_zero * V_5nV(3438) / 100; + } + // n_zero = v_z / V_5nV(34.38); + // v_zero = n_zero * V_5nV(34.38); + // if (vscan < 0) { // v_zero -= V_5nV(5372) / 10000; // v_zero -= V_5nV(0.5372); } // @@ -40,20 +47,20 @@ static int32_t DAC_outputV(int32_t voltLVraw) { // LPDAC output, voltLV = Vbia v_bias = vscan + v_zero; // v_bias = vscan + v_zero; n_bias = v_bias * 10000 / V_5nV(5372); // n_bias = v_bias / V_5nV(0.5372); - while (n_bias >= 4096) { - n_zero--; - v_zero = (int64_t)n_zero * V_5nV(3438) / 100; + // while (n_bias >= 4096) { + // n_zero--; + // v_zero = (int64_t)n_zero * V_5nV(3438) / 100; - if (vscan < 0) { - v_zero -= V_5nV(5372) / 10000; - } + // if (vscan < 0) { + // v_zero -= V_5nV(5372) / 10000; + // } - v_bias = vscan + v_zero; - n_bias = v_bias * 10000 / V_5nV(5372); + // v_bias = vscan + v_zero; + // n_bias = v_bias * 10000 / V_5nV(5372); - if (n_bias < 4096) - break; - } + // if (n_bias < 4096) + // break; + // } DACOutCode = (0x0003FFFF & ((n_zero << 12) + n_bias)); @@ -79,7 +86,11 @@ static int32_t DAC_outputV(int32_t voltLVraw) { // LPDAC output, voltLV = Vbia w32_REG(DACOutCode); ret = (int32_t)(v_bias - v_zero) / 200; //vscan - InputNotify(NOTIFY_VOLT, ret/200); + + + InputNotify(NOTIFY_CURRENT, n_zero); + InputNotify(NOTIFY_VOLT, n_bias); + InputNotify(NOTIFY_IMPEDANCE, vscan/200); return ret; } diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_PIN.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_PIN.h index 40ed408..f394cb8 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_PIN.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_PIN.h @@ -31,7 +31,7 @@ #define switch_on IOID_14 #define enable_5v IOID_9 -#define AD_reset IOID_13 +#define AD_reset IOID_7 #define enable_10v PIN_UNASSIGNED #define HIGH_Z_MODE PIN_UNASSIGNED #define shutdown_6994 PIN_UNASSIGNED