Subversion Repositories svnkaklik

Rev

Rev 659 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
1068 kaklik 1
#include "geiger.h"
6 kaklik 2
 
1068 kaklik 3
#int_EXT
4
void EXT_isr(void)
5
{
6
   output_toggle(LED3);
7
}
6 kaklik 8
 
1068 kaklik 9
 
6 kaklik 10
void main()
11
{
12
   unsigned int16 n;
13
 
14
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
15
   setup_adc(ADC_OFF);
16
   setup_spi(FALSE);
17
   setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
18
   setup_timer_1(T1_DISABLED|T1_DIV_BY_1);
19
   setup_timer_2(T2_DISABLED,0,1);
20
   setup_ccp1(CCP_OFF);
21
   setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4);
22
   setup_vref(VREF_LOW|1|VREF_A2);
23
   setup_oscillator(False);
24
 
1068 kaklik 25
   enable_interrupts(INT_EXT);
26
   enable_interrupts(GLOBAL);
27
 
28
 
6 kaklik 29
   n=0;
30
   set_timer0(0);
31
   While(true)
32
   {
33
      printf("%Lu0, %u\n\r", n++, get_timer0());     
34
      set_timer0(0);
35
      Delay_ms(10000);
36
   }
37
}