Skip to content

Commit

Permalink
Added a pic16f627a sample
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWideFoot committed Jan 2, 2012
1 parent 8e57b8a commit 5b35878
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pic16f627a/FlashLED.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <pic.h>

__CONFIG(UNPROTECT & LVPDIS & BORDIS & MCLRDIS & PWRTEN & WDTDIS & INTCLK);

#ifndef _XTAL_FREQ
// Unless already defined assume 4MHz system frequency
// This definition is required to calibrate __delay_us() and __delay_ms()
#define _XTAL_FREQ 4000000
#endif

void main(void)
{
TRISB = 0;

/* Reset the LEDs */
PORTB = 0;

/* Light the LEDs */
PORTB = 0x5A;

while(1)
{
PORTB=0XFF;
__delay_ms(100);// delay for 100 milliseconds
PORTB=0X00;
__delay_ms(100);// delay for 100 milliseconds
}
}

0 comments on commit 5b35878

Please sign in to comment.