1,19 → 1,27 |
#include <16F88.h> |
#device adc=8 |
#include "geiger.h" |
|
#FUSES NOWDT //No Watch Dog Timer |
#FUSES HS //High speed Osc (> 4mhz) |
#FUSES NOPUT //No Power Up Timer |
#FUSES MCLR //Master Clear pin enabled |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
#FUSES NODEBUG //No Debug mode for ICD |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES NOFCMEN //Fail-safe clock monitor disabled |
#FUSES NOIESO //Internal External Switch Over mode enabled |
|
#use delay(clock=20000000) |
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8) |
void main() |
{ |
unsigned int16 n; |
|
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED|T1_DIV_BY_1); |
setup_timer_2(T2_DISABLED,0,1); |
setup_ccp1(CCP_OFF); |
setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4); |
setup_vref(VREF_LOW|1|VREF_A2); |
setup_oscillator(False); |
|
n=0; |
set_timer0(0); |
While(true) |
{ |
printf("%Lu0, %u\n\r", n++, get_timer0()); |
set_timer0(0); |
Delay_ms(10000); |
} |
} |