From 48ea112f884f2837e7cab609e3b5c90b8ba2430b Mon Sep 17 00:00:00 2001 From: Michael Dryden Date: Tue, 1 Apr 2014 12:48:39 -0400 Subject: [PATCH] CV test. Disable RTC count for CV. --- DSTAT-temp/src/experiment.c | 38 ++++++++++++++++++------------------ DSTAT-temp/src/main.c | 17 ++++++++++++---- DSTAT1.atsuo | Bin 47616 -> 47616 bytes 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/DSTAT-temp/src/experiment.c b/DSTAT-temp/src/experiment.c index 925092f..ed2d5ad 100644 --- a/DSTAT-temp/src/experiment.c +++ b/DSTAT-temp/src/experiment.c @@ -220,11 +220,11 @@ void cv_experiment(int16_t v1, int16_t v2, int16_t start, uint8_t scans, uint16_ return; } - RTC.CTRL = RTC_PRESCALER_OFF_gc; - while (RTC.STATUS & RTC_SYNCBUSY_bm); - RTC.CNT = 0; - RTC.PER = 0xffff; - RTC.CTRL = RTC_PRESCALER_DIV1024_gc; // 1 s tick +// RTC.CTRL = RTC_PRESCALER_OFF_gc; +// while (RTC.STATUS & RTC_SYNCBUSY_bm); +// RTC.CNT = 0; +// RTC.PER = 0xffff; +// RTC.CTRL = RTC_PRESCALER_DIV1024_gc; // 1 s tick while(scans > 0){ if (start != v1){ @@ -242,7 +242,7 @@ void cv_experiment(int16_t v1, int16_t v2, int16_t start, uint8_t scans, uint16_ firstrun = 0; } - printf("Time: %lu s \n\r", rtc_get_time()); +// printf("Time: %lu s \n\r", rtc_get_time()); return; } @@ -386,19 +386,19 @@ static void porte_int0_lsv(void){ if (autogainswitch()==0){ noauto: - if (g_gain == POT_GAIN_300) - printf("%u %ld00000\n\r", TCC1.CNT,result); - else if (g_gain == POT_GAIN_3k) - printf("%u %ld0000\n\r", TCC1.CNT, result); - else if (g_gain == POT_GAIN_30k) - printf("%u %ld000\n\r", TCC1.CNT, result); - else if (g_gain == POT_GAIN_300k) - printf("%u %ld00\n\r", TCC1.CNT, result); - else if (g_gain == POT_GAIN_3M) - printf("%u %ld0\n\r", TCC1.CNT, result); - else if (g_gain == POT_GAIN_30M) - printf("%u %ld\n\r", TCC1.CNT, result); - else +// if (g_gain == POT_GAIN_300) +// printf("%u %ld\n\r", TCC1.CNT,result); +// else if (g_gain == POT_GAIN_3k) +// printf("%u %ld\n\r", TCC1.CNT, result); +// else if (g_gain == POT_GAIN_30k) +// printf("%u %ld000\n\r", TCC1.CNT, result); +// else if (g_gain == POT_GAIN_300k) +// printf("%u %ld00\n\r", TCC1.CNT, result); +// else if (g_gain == POT_GAIN_3M) +// printf("%u %ld0\n\r", TCC1.CNT, result); +// else if (g_gain == POT_GAIN_30M) +// printf("%u %ld\n\r", TCC1.CNT, result); +// else printf("%u %ld\n\r", TCC1.CNT, result); } diff --git a/DSTAT-temp/src/main.c b/DSTAT-temp/src/main.c index f890753..5b84083 100644 --- a/DSTAT-temp/src/main.c +++ b/DSTAT-temp/src/main.c @@ -128,7 +128,7 @@ int main(void){ // } // } - ads1255_setup(ADS_BUFF_ON,ADS_DR_7500,ADS_PGA_2); + ads1255_setup(ADS_BUFF_ON,ADS_DR_60,ADS_PGA_2); // max5443_set_voltage1(0); // pot_exp_start(); @@ -137,17 +137,26 @@ int main(void){ // ads1255_wakeup(); autogain_enable = 0; - g_gain = POT_GAIN_100; + g_gain = POT_GAIN_30k; pot_set_gain(); +// max5443_set_voltage1(-1000*(65536/(double)3000)+32768); +// int16_t volt; while (1){ +// scanf("%d",&volt); +// printf("%d\n\r",volt); +// max5443_set_voltage1(volt*(65536/(double)3000)+32768); + + // command_handler((char)getchar()); // while (1){ // while (arch_ioport_get_pin_level(IOPORT_CREATE_PIN(PORTD, 5))); // printf("%ld\n\r", ads1255_read_fast24()); // } - delay_s(1); - lsv_experiment(-1500,1499,400,2); +// delay_s(1); + getchar(); + printf("#Start"); + cv_experiment(-1500,1499,-1500,1,100); } } \ No newline at end of file diff --git a/DSTAT1.atsuo b/DSTAT1.atsuo index 4df45696c86b841780d118e13d81732a79ca7946..4d5dce4f8e30d4e80caa77ff3ea7751260016e6d 100644 GIT binary patch delta 564 zcmX|7O=uHQ5Pt7@-BLEr5Ag$haLnGEIoPiuopq2Z+FEH9y9aJd^2yxcA4$6_AN=# zTaV}0a{RV5L**nPB#hsuM!72=r!>Y7gkDDQF@6wkbQaZ^jF-7 z`k!;->mm7%KrCppJKuvZPOmv^*PW228CnzBy@u1cwRPW#0L=g7~v!+KpVps&-=hH2&U#U`L&Ygf=i8P(7 z6wwPIELIfF_LlQ;#Cag>US7D?rRuy82KezFwfduIdU7HC4~IP4x$%@?pm7vVqsEsT dD}!_}xb6K<;|kd$w0-{7t+yL=N8r7C@)ux{!!7^- delta 603 zcmXw0O-vI}5T4m?xBP4yT1!Qdx;0ufO=>|U9u(KuM5&f8h68O{3bhqbF~k%Po|eP| z2LjlMN#n(&B${|2>bvNHWTTuF2{#iiMx!@P_F|0S+g+K%y!pQQ=6!i@bW_kx;pH7s zTK+l{*i5l|;&pU)0YDS|?T<0jeHt;yPI#U+qu*l4Y#TsbERD*;b^Ek z2^A>8EKEQirePeW;4Z}B26(|*1HhTS@l&($Nw!vYAw|-cXt6GF?;gq&y?&o9vC>IH z;aOnYl^v8XaEra5?-TR1oeeR4a#0}PbT2b*&$pxE{P^6*J_(O-ZL71aH(S`@RBspl E0q4}w?EnA( -- GitLab