Created
September 6, 2012 19:56
-
-
Save TAUTIC/3659937 to your computer and use it in GitHub Desktop.
PIC16F1503 Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <xc.h> | |
#ifndef _XTAL_FREQ | |
#define _XTAL_FREQ 16000000 | |
#endif | |
#pragma config WDTE=OFF, MCLRE=ON, CP=OFF, FOSC=INTOSC | |
void main(int argc, char** argv) { | |
TRISA = 0b00000000; | |
OSCCONbits.IRCF = 0b1111; | |
while(1) { | |
LATAbits.LATA0 = 1; | |
LATAbits.LATA2 = 0; | |
__delay_ms(100); | |
LATAbits.LATA0 = 0; | |
LATAbits.LATA1 = 1; | |
__delay_ms(100); | |
LATAbits.LATA1 = 0; | |
LATAbits.LATA2 = 1; | |
__delay_ms(100); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment