| Line 35... |
Line 35... |
| 35 |
setup_timer_1(T1_DISABLED); |
35 |
setup_timer_1(T1_DISABLED); |
| 36 |
setup_timer_2(T2_DISABLED,0,1); |
36 |
setup_timer_2(T2_DISABLED,0,1); |
| 37 |
setup_ccp1(CCP_OFF); |
37 |
setup_ccp1(CCP_OFF); |
| 38 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
38 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
| 39 |
|
39 |
|
| 40 |
|
- |
|
| 41 |
set_tris_d(0x00); |
40 |
set_tris_d(0x00); |
| 42 |
|
41 |
|
| 43 |
TDC_reset(); |
42 |
TDC_reset(); |
| 44 |
|
43 |
|
| 45 |
output_low(START); |
44 |
output_low(START); |
| Line 54... |
Line 53... |
| 54 |
TDC_reset(); |
53 |
TDC_reset(); |
| 55 |
delay_ms(100); |
54 |
delay_ms(100); |
| 56 |
|
55 |
|
| 57 |
while(TRUE) |
56 |
while(TRUE) |
| 58 |
{ |
57 |
{ |
| 59 |
|
- |
|
| 60 |
|
58 |
|
| 61 |
//----------------------------------------------- Nastaveni registru |
59 |
//----------------------------------------------- Nastaveni registru |
| 62 |
|
60 |
|
| 63 |
MRange=TDC_MRANGE2; // sets measurement mode |
61 |
MRange=TDC_MRANGE2; // sets measurement mode |
| 64 |
hit1=TDC_MRANGE2_HIT1_START; |
62 |
hit1=TDC_MRANGE2_HIT1_START; |
| 65 |
hitin1=TDC_HITIN1_4; // set nomber of hits on channel 1 |
63 |
hitin1=TDC_HITIN1_4; // set nomber of hits on channel 1 |