Line 129... |
Line 129... |
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,1,1,0), TDC_mrange1_get_time(2,1,2,0)); |
134 |
printf("%6.6f %6.6f", TDC_mrange1_get_time(1,1,1,0), TDC_mrange1_get_time(2,1,2,0)); |
135 |
// syntax TDC_mrange1_get_time(HIT1:[Channel, shot], HIT2:[Channel , shot]) time=HIT1-HIT2 and does not support negative output |
135 |
// syntax TDC_mrange1_get_time(HIT1:[Channel, shot], HIT2:[Channel , shot]) time=HIT1-HIT2 and does not support negative output |
136 |
printf("\r\n"); |
136 |
printf("\r\n"); |
137 |
} |
137 |
} |
138 |
|
138 |
|
139 |
|
139 |
|
Line 146... |
Line 146... |
146 |
MRange=TDC_MRANGE2; // sets measurement mode |
146 |
MRange=TDC_MRANGE2; // sets measurement mode |
147 |
hit1=TDC_MRANGE2_HIT1_START; // time is always counted from start pulse at this measurement mode |
147 |
hit1=TDC_MRANGE2_HIT1_START; // time is always counted from start pulse at this measurement mode |
148 |
hitin2=TDC_HITIN2_0; // disable channel 2 (normal state for this mode) |
148 |
hitin2=TDC_HITIN2_0; // disable channel 2 (normal state for this mode) |
149 |
en_int= TDC_INT_ALU | TDC_INT_ENDHIT | TDC_INT_TIMEOUT; // eneble all possible interrupt flags |
149 |
en_int= TDC_INT_ALU | TDC_INT_ENDHIT | TDC_INT_TIMEOUT; // eneble all possible interrupt flags |
150 |
en_err_val=TDC_ERRVAL_EN; // enable of error value output |
150 |
en_err_val=TDC_ERRVAL_EN; // enable of error value output |
151 |
clkhsdiv=TDC_CLKHSDIV_4; // divide clkHS by 4 |
151 |
clkhsdiv=TDC_CLKHSDIV_2; // divide clkHS by 4 |
152 |
firenum=TDC_FIRENUM_1; |
152 |
firenum=TDC_FIRENUM_1; |
153 |
|
153 |
|
154 |
switch(hits) // sets number of hits on channel 1 |
154 |
switch(hits) // sets number of hits on channel 1 |
155 |
{ |
155 |
{ |
156 |
case 1: |
156 |
case 1: |
Line 230... |
Line 230... |
230 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
230 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
231 |
|
231 |
|
232 |
TDC_reset(); |
232 |
TDC_reset(); |
233 |
delay_ms(50); |
233 |
delay_ms(50); |
234 |
|
234 |
|
235 |
printf("\r\n\r\n# TDC%s (C) 2011 Jakub Kakona\r\n",VERSION); // Welcome message |
235 |
printf("\r\n\r\n# TDC%s (C) 2011 Jakub Kakona kaklik@mlab.cz\r\n",VERSION); // Welcome message |
236 |
// printf("#%s\r\n",&REV[4]); |
236 |
// printf("#%s\r\n",&REV[4]); |
237 |
|
237 |
|
238 |
while(TRUE) |
238 |
while(TRUE) |
239 |
{ |
239 |
{ |
240 |
printf("$TDC%s->", VERSION); // print prompt |
240 |
printf("$TDC%s->", VERSION); // print prompt |