Run Iin_Vin_Vout_plot() at CURVE_IT.

This commit is contained in:
Benny Liu
2021-07-02 11:22:28 +08:00
parent 2ff582a0c5
commit 78cc816ba3
4 changed files with 34 additions and 6 deletions
@@ -20,4 +20,17 @@ static void rt_vscan(void)
Vset = rt->_Vinit;
}
}
static void it_vscan(void)
{
struct wm_it_ctx_t *it = (struct wm_it_ctx_t *)wm_get();
if (vscanReset) {
Vset = it->_Vinit;
}
if(!vscanReset) {
Vset = it->_Vinit;
}
}
#endif
@@ -82,10 +82,6 @@ static void DACenable(uint8_t afterRead){
volt_out();
break;
case CURVE_IT:
volt_out();
break;
default:
break;
}
@@ -102,6 +98,10 @@ static void DACenable(uint8_t afterRead){
CalcuResistance();
break;
case CURVE_IT:
volt_out();
break;
case CURVE_CV:
case CURVE_CA:
case CURVE_LSV:
@@ -784,7 +784,7 @@ static void update_ZM_instruction(uint8 *ins) {
instru.sampleRate = 15;
instru.VsetRate = 2;
// instru.Ve1 = 25000 + 5000; // Vout = 0.1 V at RT mode
instru.Ve1 = ((uint16_t)ins[3] << 8) | (uint16_t)ins[4];
instru.Ve1 = ((uint16_t)ins[5] << 8) | (uint16_t)ins[6];
instru.Vinit = (int32_t)instru.Ve1;
if (instru.notifyRate > 1000) {
@@ -861,6 +861,8 @@ static void update_ZM_instruction(uint8 *ins) {
instru.notifyRate = ((uint32_t)ins[3] << 8) | (uint32_t)ins[4];
instru.notifyRate = 10000 / instru.notifyRate * 10;
instru.sampleRate = 15;
instru.Ve1 = ((uint16_t)ins[5] << 8) | (uint16_t)ins[6];
instru.Vinit = (int32_t)instru.Ve1;
if (instru.notifyRate > 1000) {
// slow notify rate, < 10sps, auto gain changer only use ADC gain level = 1.2.3.4
@@ -871,6 +873,12 @@ static void update_ZM_instruction(uint8 *ins) {
instru.gain_switch_on = 0b01110000;
}
if(instru.Ve1 < DAC_VOUT_GAIN_LARGE_BOUNDARY_USERCODE && instru.Ve1 > DAC_VOUT_GAIN_LARGE_BOUNDARY1_USERCODE){
instru.VoutGainLevel = VOUT_GAIN_15K;
} else {
instru.VoutGainLevel = VOUT_GAIN_240K;
}
ModeLED(WORKING);
break;
@@ -430,9 +430,12 @@ static void EliteADCControl(void)
break;
case CURVE_IT:
IT_Plot();
Iin_Vin_Vout_Plot();
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if(volt_rec_en) {
InputNotify(NOTIFY_VOLT, MEAS_VOUT(wm));
}
break;
@@ -512,6 +515,10 @@ static void vscan_ctrl(void)
rt_vscan();
break;
case CURVE_IT:
it_vscan();
break;
case CURVE_CV:
cv_vscan();
break;