Created
May 9, 2015 16:24
-
-
Save rutles/b497458e2d45349c163f to your computer and use it in GitHub Desktop.
PIC12F1822 application for MC6800 clock generator.
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
//mc6800 clock generator | |
//device: PIC12F1822(5V) | |
//compiler: HI-TECH PICC 9.80a | |
#include <pic.h> | |
__CONFIG(FOSC_INTOSC & WDTE_OFF); | |
void main(){ | |
CCP1SEL = 1; | |
P1BSEL = 1; | |
OSCCON = 0b11110000; //32MHz | |
ANSELA = 0; //digital | |
TRISA = 0; //output | |
CCP1CON = 0b10001100; //half-bridge | |
PR2 = 7; //PWM cycle | |
CCPR1L = 4; //duty cycle | |
CCPR1H = 4; //initial duty cycle | |
PWM1CON = 1;//delay | |
T2CON = 0; //not use prescale | |
TMR2 = 0; //TMR2 clear | |
TMR2ON = 1; //TMR2 start | |
while(1){ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment