o: ActiveSupport::Cache::Entry :@compressedF: @value"J/"D/
main.c
4 4

  
5 5
#define VERSION   0.1
6 6

  
7
#define START  PIN_D4
8
#define STOP1  PIN_D5
9
#define STOP2  PIN_D6
10

  
7 11
void main()
8 12
{
9 13
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
......
21 25
   TDC_reset();
22 26
   
23 27
   hit1=TDC_MRANGE2_HIT1_START;
24
   hit2=TDC_MRANGE2_HIT2_1CH1;
28
   hit2=TDC_MRANGE2_HIT2_2CH1;
25 29
   hitin1=TDC_HITIN1_2;
26 30
   hitin2=TDC_HITIN1_0;
31
   en_int= 0xFF; //TDC_INT_ALU | TDC_INT_ENDHIT | TDC_INT_TIMEOUT;
32
   en_err_val=TDC_ERRVAL_EN;
33
   delval1=0x0;
34
   delval2=0x0;
35
   delval3=0x0;
27 36
  
28 37
   TDC_update_registers();
29 38
      
39
   output_low(START);
40
   output_low(STOP1);
41
   output_low(STOP2);
42
   
43
   TDC_start_cal();
44
   delay_ms(50);
45
      
30 46
   while(true)
31 47
   {
48

  
49
/*      delay_ms(500);
50
      hit2=0x00;
51
      hit1=0x00;
52
      TDC_update_registers();
53
      printf("reg1: %X \n", TDC_get_reg1());
54

  
55
      TDC_reset();
56
      delay_ms(50);
57
      printf("reg1: %X \n", TDC_get_reg1());
58
*/
32 59
      TDC_init();
60
      delay_ms(50);
61
      printf("status: %LX \n", TDC_get_status());
62
      delay_us(10);
63
      TDC_start_cycle();
64
      delay_us(10);
65
      output_high(START);
66
      delay_us(1);
67
      output_low(START);
68
      
69
      delay_us(500);
70
      
71
      output_high(STOP1);
72
      delay_us(10);
73
      output_low(STOP1);      
74
      delay_us(500);
75
      output_high(STOP1);
76
      delay_us(10);
77
      output_low(STOP1); 
78
      delay_us(500); 
79
      output_high(STOP1);
80
      delay_us(10);
81
      output_low(STOP1);
82

  
83
      delay_ms(100);
84
      printf("status: %LX \n", TDC_get_status());
85
      delay_ms(50);
86
      printf("measured: %LX, %LX, %LX, %LX \n", TDC_get_measurement(1), TDC_get_measurement(2), TDC_get_measurement(3), TDC_get_measurement(4));
33 87
      delay_ms(500);
34
      printf("measured: %LX, %LX, %LX, %LX \n", TDC_get_measurement(1), TDC_get_measurement(2), TDC_get_measurement(3), TDC_get_measurement(4));
88
      
35 89
   };
36 90
}
:@created_atf1425756573.3333189U:@expires_in0