/Designs/Measuring_instruments/AWS01A/SW/PIC16F887/test_interrupt/main.c
0,0 → 1,49
#CASE // Case sensitive compiler
 
#include "main.h"
 
#define LED PIN_A5 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5
 
#int_RDA
void RDA_isr(void)
{
getc();
printf("&");
}
 
#int_TIMER1
void TIMER1_isr(void)
{
printf("!");
}
 
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
// setup_wdt(WDT_2304MS|WDT_DIV_16);
setup_wdt(WDT_OFF);
setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
enable_interrupts(INT_RDA);
enable_interrupts(INT_TIMER1);
enable_interrupts(GLOBAL);
setup_oscillator(OSC_8MHZ);
 
//Example blinking LED program
while(TRUE)
{
printf("@:");
output_low(LED);
delay_ms(200);
output_high(LED);
delay_ms(200);
restart_wdt();
}
}
#include "..\common\dbloader.h"
 
/Designs/Measuring_instruments/AWS01A/SW/PIC16F887/test_interrupt/main.h
0,0 → 1,20
#include <16F887.h>
#device adc=8
 
#FUSES WDT //Watch Dog Timer
#FUSES INTRC //Internal RC Osc
#FUSES NOPUT //No Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOCPD //No EE protection
#FUSES NOBROWNOUT //No brownout reset
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOWRT //Program memory not write protected
#FUSES BORV40 //Brownout reset at 4.0V
 
#use delay(clock=8000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,restart_wdt,errors)
 
/Designs/Measuring_instruments/AWS01A/SW/PIC16F887/test_interrupt/main.pjt
0,0 → 1,28
[PROJECT]
Target=C:\Users\kakl\Documents\PIC\meteostanice\PIC16F887\test\main.hex
Development_Mode=
Processor_Text=PIC16F887
ToolSuite=CCS
Processor=0x887F
[C:\Users\kakl\Documents\PIC\meteostanice\PIC16F887\test\main]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
[mru-list]
1=C:\Users\kakl\Documents\PIC\meteostanice\PIC16F887\test\main.c
[Windows]
0=0000 %S 0 0 796 451 3 0
[Units]
Link=0
Count=1
1=C:\Users\kakl\Documents\PIC\meteostanice\PIC16F887\test\main
[Opened Files]
1=main.c
2=main.h
3=..\..\..\..\..\..\..\Program Files (x86)\PICC\Devices\16F887.h
4=..\common\dbloader.h
5=..\common\bloader_defs.h
6=