Skip to content

Instantly share code, notes, and snippets.

@vintagechips
Last active March 14, 2018 02:57
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 vintagechips/aaec058e25113f1f4f8b167fe73148ff to your computer and use it in GitHub Desktop.
Save vintagechips/aaec058e25113f1f4f8b167fe73148ff to your computer and use it in GitHub Desktop.
MC6809 clock generator made with PIC12F1822
/*
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