Skip to content
Snippets Groups Projects
Commit c6f52963 authored by Michael DM Dryden's avatar Michael DM Dryden
Browse files

Add pmt idle mode.

parent 71142f35
1 merge request!1Develop
...@@ -48,6 +48,7 @@ static void ca_cca_callback(void); ...@@ -48,6 +48,7 @@ static void ca_cca_callback(void);
static void portd_int0_ca(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 _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 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 //interrupt callback setup
typedef void (*port_callback_t) (void); typedef void (*port_callback_t) (void);
...@@ -101,6 +102,10 @@ void experiment_handler(char command){ ...@@ -101,6 +102,10 @@ void experiment_handler(char command){
dpv_experiment(p1,p2,u1,u2,u3,u4); dpv_experiment(p1,p2,u1,u2,u3,u4);
break; 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 #if BOARD_VER_MAJOR == 1 && BOARD_VER_MINOR >= 2
case 'P': //potentiometry - time, OCP/poteniometry case 'P': //potentiometry - time, OCP/poteniometry
scanf("%u%hhu",&pct1, &o1); scanf("%u%hhu",&pct1, &o1);
...@@ -787,6 +792,23 @@ void pot_experiment(uint16_t time_seconds, uint8_t exp_type){ ...@@ -787,6 +792,23 @@ void pot_experiment(uint16_t time_seconds, uint8_t exp_type){
} }
#endif #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[]){ void ca_experiment(uint16_t steps, uint16_t step_dac[], uint16_t step_seconds[]){
/** /**
* Performs a chronoamperometry experiment. * Performs a chronoamperometry experiment.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment