diff --git a/DSTAT/src/experiment.c b/DSTAT/src/experiment.c index cae290048d17892dacd3944cd1a5af6ee317153a..857f8a59639930eec9fd028562b3f531c59fc9e3 100644 --- a/DSTAT/src/experiment.c +++ b/DSTAT/src/experiment.c @@ -48,6 +48,7 @@ static void ca_cca_callback(void); static void portd_int0_ca(void); static uint8_t _swv_singledir(uint16_t dacindex, uint16_t dacindex_stop, uint16_t dacindex_pulse_height, uint16_t dacindex_step, uint8_t direction); static uint8_t _dpv_singledir(uint16_t dacindex, uint16_t dacindex_stop, uint16_t dacindex_pulse_height, uint16_t dacindex_step, uint8_t direction); +static void pmt_idle(void); //interrupt callback setup typedef void (*port_callback_t) (void); @@ -101,6 +102,10 @@ void experiment_handler(char command){ dpv_experiment(p1,p2,u1,u2,u3,u4); break; + case 'M': //PMT idle mode - holds voltage at 0 V with no data output + pmt_idle(); + break; + #if BOARD_VER_MAJOR == 1 && BOARD_VER_MINOR >= 2 case 'P': //potentiometry - time, OCP/poteniometry scanf("%u%hhu",&pct1, &o1); @@ -787,6 +792,23 @@ void pot_experiment(uint16_t time_seconds, uint8_t exp_type){ } #endif +void pmt_idle(void){ + max5443_set_voltage1(65535); + ioport_set_pin_level(PIN_POT_2ELECTRODE, 1); + delay_ms(100); + ioport_set_pin_level(PIN_POT_CE, 1); + + while (1){ + if (udi_cdc_is_rx_ready()){ + if (getchar() == 'a'){ + printf("##ABORT\n\r"); + // Doesn't disconnect control line to minimize time this is floating + return; + } + } + } +} + void ca_experiment(uint16_t steps, uint16_t step_dac[], uint16_t step_seconds[]){ /** * Performs a chronoamperometry experiment.