Line 43... |
Line 43... |
43 |
{ |
43 |
{ |
44 |
TDC_reset(); |
44 |
TDC_reset(); |
45 |
delay_ms(50); |
45 |
delay_ms(50); |
46 |
en_int= TDC_INT_ALU | TDC_INT_ENDHIT | TDC_INT_TIMEOUT; // eneble all possible interrupt flags |
46 |
en_int= TDC_INT_ALU | TDC_INT_ENDHIT | TDC_INT_TIMEOUT; // eneble all possible interrupt flags |
47 |
en_err_val=TDC_ERRVAL_EN; // enable of error value output |
47 |
en_err_val=TDC_ERRVAL_EN; // enable of error value output |
48 |
clkhsdiv=TDC_CLKHSDIV_2; // divide clkHS by 2 |
48 |
clkhsdiv=TDC_CLKHSDIV_1; // divide clkHS by 1 |
49 |
firenum=TDC_FIRENUM_1; |
49 |
firenum=TDC_FIRENUM_1; |
50 |
calibrate=TDC_CALIBRATE_EN; |
50 |
calibrate=TDC_CALIBRATE_EN; |
51 |
disautocal=TDC_AUTOCAL_EN; // automatic calibration enabled |
51 |
disautocal=TDC_AUTOCAL_EN; // automatic calibration enabled |
52 |
|
52 |
|
53 |
rfedge2=TDC_CH2EDGE_FAL_RIS; // stop channels input edge sensityvity selection |
53 |
rfedge2=TDC_CH2EDGE_FAL_RIS; // stop channels input edge sensityvity selection |
Line 124... |
Line 124... |
124 |
|
124 |
|
125 |
While(!input(INTN_PIN)); // waiting for interrupt flag |
125 |
While(!input(INTN_PIN)); // waiting for interrupt flag |
126 |
|
126 |
|
127 |
//----------------------------------------------- Pocitani |
127 |
//----------------------------------------------- Pocitani |
128 |
|
128 |
|
129 |
printf("[%Lu %Lu %Lu %Lu %Lu %Lu %Lu]\r\n", (1&(TDC_get_status())>>12), (1&(TDC_get_status())>>11), (1&(TDC_get_status())>>10), 1&(TDC_get_status())>>9, 7&(TDC_get_status())>>6, 7&(TDC_get_status())>>3, 7&TDC_get_status()); |
129 |
// printf("[%Lu %Lu %Lu %Lu %Lu %Lu %Lu]\r\n", (1&(TDC_get_status())>>12), (1&(TDC_get_status())>>11), (1&(TDC_get_status())>>10), 1&(TDC_get_status())>>9, 7&(TDC_get_status())>>6, 7&(TDC_get_status())>>3, 7&TDC_get_status()); |
130 |
|
130 |
|
131 |
delay_ms(10); |
131 |
delay_ms(10); |
132 |
|
132 |
|
133 |
printf("$TDC%s M1 ", VERSION); |
133 |
printf("$TDC%s M1 ", VERSION); |
134 |
printf("%5.6f %5.6f", TDC_mrange1_get_time(1,0,1,1), TDC_mrange1_get_time(2,1,2,0)); |
134 |
printf("%5.6f %5.6f", TDC_mrange1_get_time(1,1,1,0), TDC_mrange1_get_time(2,1,2,0)); |
135 |
|
- |
|
136 |
// syntax TDC_mrange1_get_time(Channel, shot, Channel , shot ) |
135 |
// syntax TDC_mrange1_get_time(HIT1:[Channel, shot], HIT2:[Channel , shot]) time=HIT1-HIT2 and does not support negative output |
137 |
|
- |
|
138 |
printf("\r\n"); |
136 |
printf("\r\n"); |
139 |
} |
137 |
} |
140 |
|
138 |
|
141 |
|
139 |
|
142 |
void measurementM2(unsigned int hits) |
140 |
void measurementM2(unsigned int hits) |
Line 241... |
Line 239... |
241 |
{ |
239 |
{ |
242 |
printf("$TDC%s->", VERSION); // print prompt |
240 |
printf("$TDC%s->", VERSION); // print prompt |
243 |
get_command(command, 20); // receive command from terminal |
241 |
get_command(command, 20); // receive command from terminal |
244 |
printf("%s\r\n", command); // echo received command |
242 |
printf("%s\r\n", command); // echo received command |
245 |
|
243 |
|
- |
|
244 |
|
- |
|
245 |
// delay_ms(50); |
- |
|
246 |
// strcpy(command,"M1 1 1"); |
- |
|
247 |
|
- |
|
248 |
|
246 |
strcpy(tmp,"TM"); |
249 |
strcpy(tmp,"TM"); |
247 |
if (!strncmp(command, tmp, 2)) temperature_measurement(); |
250 |
if (!strncmp(command, tmp, 2)) temperature_measurement(); |
248 |
|
251 |
|
249 |
strcpy(tmp,"M2 "); |
252 |
strcpy(tmp,"M2 "); |
250 |
if (!strncmp(command, tmp, 3)) |
253 |
if (!strncmp(command, tmp, 3)) |