2830 |
kakl |
1 |
#CASE // Case sensitive compiler |
|
|
2 |
|
|
|
3 |
#include "main.h" |
|
|
4 |
|
|
|
5 |
#define LED PIN_A5 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5 |
|
|
6 |
|
|
|
7 |
#int_RDA |
|
|
8 |
void RDA_isr(void) |
|
|
9 |
{ |
|
|
10 |
getc(); |
|
|
11 |
printf("&"); |
|
|
12 |
} |
|
|
13 |
|
|
|
14 |
#int_TIMER1 |
|
|
15 |
void TIMER1_isr(void) |
|
|
16 |
{ |
|
|
17 |
printf("!"); |
|
|
18 |
} |
|
|
19 |
|
|
|
20 |
void main() |
|
|
21 |
{ |
|
|
22 |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
|
|
23 |
setup_adc(ADC_CLOCK_DIV_2); |
|
|
24 |
setup_spi(SPI_SS_DISABLED); |
|
|
25 |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
26 |
// setup_wdt(WDT_2304MS|WDT_DIV_16); |
|
|
27 |
setup_wdt(WDT_OFF); |
|
|
28 |
setup_timer_1(T1_INTERNAL|T1_DIV_BY_8); |
|
|
29 |
setup_timer_2(T2_DISABLED,0,1); |
|
|
30 |
setup_ccp1(CCP_OFF); |
|
|
31 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
|
|
32 |
enable_interrupts(INT_RDA); |
|
|
33 |
enable_interrupts(INT_TIMER1); |
|
|
34 |
enable_interrupts(GLOBAL); |
|
|
35 |
setup_oscillator(OSC_8MHZ); |
|
|
36 |
|
|
|
37 |
//Example blinking LED program |
|
|
38 |
while(TRUE) |
|
|
39 |
{ |
|
|
40 |
printf("@:"); |
|
|
41 |
output_low(LED); |
|
|
42 |
delay_ms(200); |
|
|
43 |
output_high(LED); |
|
|
44 |
delay_ms(200); |
|
|
45 |
restart_wdt(); |
|
|
46 |
} |
|
|
47 |
} |
|
|
48 |
#include "..\common\dbloader.h" |
|
|
49 |
|