Skip to content

Instantly share code, notes, and snippets.

@TAUTIC
Created September 6, 2012 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TAUTIC/3659937 to your computer and use it in GitHub Desktop.
Save TAUTIC/3659937 to your computer and use it in GitHub Desktop.
PIC16F1503 Demo
#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