/Designs/ohradnik/SW/887/main.c
0,0 → 1,36
#include "main.h"
 
 
#define T1 PIN_D1 // charging
#define T2 PIN_D2 // discharging
 
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_timer_1(T1_DISABLED);
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
setup_oscillator(OSC_8MHZ);
 
output_high(T1);
output_high(T2);
delay_ms(1000);
 
while(true)
{
output_low(T1); // charge
delay_ms(1000);
output_high(T1); // charge off
delay_ms(300);
output_low(T2); // discharge
delay_ms(200);
output_high(T2); // discharge off
delay_ms(300);
}
 
}
/Designs/ohradnik/SW/887/main.h
0,0 → 1,19
#include <16F887.h>
#device adc=8
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC //Internal RC Osc
#FUSES PUT //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,RESTART_WDT)
 
/Designs/ohradnik/SW/887/main.pjt
0,0 → 1,26
[PROJECT]
Target=Z:\home\kakl\svn\MLAB\Designs\ohradnik\SW\887\main.hex
Development_Mode=
Processor_Text=PIC16F887
ToolSuite=CCS
Processor=0x887F
[Z:\home\kakl\svn\MLAB\Designs\ohradnik\SW\887\main]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
[mru-list]
1=Z:\home\kakl\svn\MLAB\Designs\ohradnik\SW\887\main.c
[Windows]
0=0000 %S 0 0 796 451 3 0
[Units]
Link=0
Count=1
1=Z:\home\kakl\svn\MLAB\Designs\ohradnik\SW\887\main
[Opened Files]
1=main.c
2=main.h
3=C:\Program Files (x86)\PICC\Devices\16F887.h
4=