Last active
March 14, 2018 02:57
-
-
Save vintagechips/aaec058e25113f1f4f8b167fe73148ff to your computer and use it in GitHub Desktop.
MC6809 clock generator made with PIC12F1822
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
/* | |
MC6809 cock generator | |
Device: PIC12F1822 | |
Compiler: XC8 | |
*/ | |
#include <xc.h> | |
#pragma config FOSC = INTOSC | |
#pragma config WDTE = OFF | |
#pragma config MCLRE = ON | |
#pragma config CLKOUTEN = OFF | |
#pragma config PLLEN = ON | |
void main() { | |
// initialize | |
OSCCON = 0b11110000; | |
ANSELA = 0; | |
TRISA = 0; | |
// clock generate | |
while(1){ | |
LATA1 = 1; | |
NOP(); | |
NOP(); | |
LATA2 = 1; | |
NOP(); | |
NOP(); | |
LATA1 = 0; | |
NOP(); | |
NOP(); | |
LATA2 = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment