Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include <xc.

h>
#include <pic16f616.h>
#pragma config FOSC = INTOSCCLK // Oscillator Selection bits (INTOSC oscillator:
CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN)
#pragma config WDTE = OFF
// Watchdog Timer Enable bit (WDT disabled and c
an be enabled by SWDTEN bit of the WDTCON register)
#pragma config PWRTE = OFF
// Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = ON
// MCLR Pin Function Select bit (MCLR pin functi
on is MCLR)
#pragma config CP = OFF
// Code Protection bit (Program memory code prot
ection is disabled)
#pragma config IOSCFS = 8MHZ
// Internal Oscillator Frequency Select bit (8 M
Hz)
#pragma config BOREN = OFF
// Brown-out Reset Selection bits (BOR Disabled)
void main(void)
{
TRISCbits.TRISC5=1;
PR2=49;
CCP1CON=0x0C;
CCPR1L=25;
TMR2IF=0;
T2CON=0X00;
TMR2ON=1;
while(!TMR2IF);
TRISCbits.TRISC5=0;
while (1);
}

You might also like