Subversion Repositories svnkaklik

Rev

Rev 410 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 410 Rev 659
1
#include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h"
1
#include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h"
2
 
2
 
3
 
3
 
4
void main()
4
void main()
5
{
5
{
6
   unsigned int16 n;
6
   unsigned int16 n;
7
   
7
   
8
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
8
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
9
   setup_adc(ADC_OFF);
9
   setup_adc(ADC_OFF);
10
   setup_spi(FALSE);
10
   setup_spi(FALSE);
11
   setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
11
   setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
12
   setup_timer_1(T1_DISABLED|T1_DIV_BY_1);
12
   setup_timer_1(T1_DISABLED|T1_DIV_BY_1);
13
   setup_timer_2(T2_DISABLED,0,1);
13
   setup_timer_2(T2_DISABLED,0,1);
14
   setup_ccp1(CCP_OFF);
14
   setup_ccp1(CCP_OFF);
15
   setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4);
15
   setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4);
16
   setup_vref(VREF_LOW|1|VREF_A2);
16
   setup_vref(VREF_LOW|1|VREF_A2);
17
   setup_oscillator(False);
17
   setup_oscillator(False);
18
   
18
   
19
   n=0;
19
   n=0;
20
   set_timer0(0);
20
   set_timer0(0);
21
   While(true)
21
   While(true)
22
   {
22
   {
23
      printf("%Lu0, %u\n\r", n++, get_timer0());     
23
      printf("%Lu0, %u\n\r", n++, get_timer0());     
24
      set_timer0(0);
24
      set_timer0(0);
25
      Delay_ms(10000);
25
      Delay_ms(10000);
26
   }
26
   }
27
}
27
}