Line 343... |
Line 343... |
343 |
case 4: |
343 |
case 4: |
344 |
if (channel2 == 1) hit2=TDC_MRANGE1_HIT2_4CH1; else hit2=TDC_MRANGE1_HIT2_4CH2; |
344 |
if (channel2 == 1) hit2=TDC_MRANGE1_HIT2_4CH1; else hit2=TDC_MRANGE1_HIT2_4CH2; |
345 |
break; |
345 |
break; |
346 |
} |
346 |
} |
347 |
|
347 |
|
348 |
// hit2=TDC_MRANGE1_HIT2_START; |
- |
|
349 |
// hit1=TDC_MRANGE1_HIT1_1CH1; |
- |
|
350 |
|
- |
|
351 |
TDC_update_reg1(); // tell to ALU which shot period must be computed |
348 |
TDC_update_reg1(); // tell to ALU which shot period must be computed |
352 |
|
349 |
|
353 |
Delay_ms(50); // wait to computing of result |
350 |
Delay_ms(50); // wait to computing of result |
354 |
|
351 |
|
355 |
measurement=TDC_get_measurement(7&TDC_get_status()); // read computed value on pointer result register address |
352 |
measurement=TDC_get_measurement(7&TDC_get_status()); // read computed value on pointer result register address |
356 |
|
353 |
|
357 |
printf("%Lu\r\n", (7&TDC_get_status())); |
354 |
// printf("%Lu\r\n", (7&TDC_get_status())); |
358 |
printf("%Lu\r\n", measurement); |
355 |
// printf("%Lu\r\n", measurement); |
359 |
|
356 |
|
360 |
switch (clkhsdiv) |
357 |
switch (clkhsdiv) |
361 |
{ |
358 |
{ |
362 |
case TDC_CLKHSDIV_1: |
359 |
case TDC_CLKHSDIV_1: |
363 |
time=(measurement/65536.0)* 1.0e6/TDC_CLKHS; |
360 |
time=(measurement/65536.0)* 1.0e6/TDC_CLKHS; |