diff --git a/src/experiment.c b/src/experiment.c index e7b39a9eff2d5522089c859b65dc7a0cbe0efe00..5c1b11b9a1458adee27308cd2033c12e97562d98 100644 --- a/src/experiment.c +++ b/src/experiment.c @@ -639,35 +639,35 @@ uint8_t lsv_experiment(int16_t start, int16_t stop, uint16_t slope, int8_t first tc_set_cca_interrupt_callback(&EXP_TC1_0, lsv_cca_callback); portd_int0_callback = porte_int0_lsv; //ADC read //set EVCH0 event - EVSYS.CH0MUX = EVSYS_CHMUX_TCC0_OVF_gc; + EVSYS.CH0MUX = EVSYS_CHMUX_TCD0_OVF_gc; EVSYS.CH0CTRL = 0; timer_period = ceil(1/((double)slope/(3000./65536))*(F_CPU)); temp_div = ceil(timer_period/65536.); if (temp_div <= 1) - tc_write_clock_source(&TCC0,TC_CLKSEL_DIV1_gc); + tc_write_clock_source(&EXP_TC0_0,TC_CLKSEL_DIV1_gc); else if (temp_div == 2){ - tc_write_clock_source(&TCC0,TC_CLKSEL_DIV2_gc); + tc_write_clock_source(&EXP_TC0_0,TC_CLKSEL_DIV2_gc); timer_period /= 2; } else if (temp_div <= 4){ - tc_write_clock_source(&TCC0,TC_CLKSEL_DIV4_gc); + tc_write_clock_source(&EXP_TC0_0,TC_CLKSEL_DIV4_gc); timer_period /= 4; } else if (temp_div <= 8){ - tc_write_clock_source(&TCC0,TC_CLKSEL_DIV8_gc); + tc_write_clock_source(&EXP_TC0_0,TC_CLKSEL_DIV8_gc); timer_period /= 8; } else if (temp_div <= 64){ - tc_write_clock_source(&TCC0,TC_CLKSEL_DIV64_gc); + tc_write_clock_source(&EXP_TC0_0,TC_CLKSEL_DIV64_gc); timer_period /= 64; } else if (temp_div <= 256){ - tc_write_clock_source(&TCC0,TC_CLKSEL_DIV256_gc); + tc_write_clock_source(&EXP_TC0_0,TC_CLKSEL_DIV256_gc); timer_period /= 256; } else if (temp_div <= 1024){ - tc_write_clock_source(&TCC0,TC_CLKSEL_DIV1024_gc); + tc_write_clock_source(&EXP_TC0_0,TC_CLKSEL_DIV1024_gc); timer_period /= 1024; } else{ diff --git a/src/experiment.h b/src/experiment.h index 10648dbcb8e71188329ea471d6dddbf5cc01e14f..eabe34fd1e65b4ee7d5b6a1690100cdc1b58097b 100644 --- a/src/experiment.h +++ b/src/experiment.h @@ -76,8 +76,8 @@ #define RTC_COMPARE_INT_LEVEL RTC_COMPINTLVL_HI_gc -#define EXP_TC0_0 TCC0 -#define EXP_TC1_0 TCC1 +#define EXP_TC0_0 TCD0 +#define EXP_TC1_0 TCD1 #define EXP_TC0_1 TCF0 extern uint16_t g_gain;