/* * File: clk6809e.c */ #include // Configuration Word Register 1 #pragma config FOSC = INTOSC // Oscillator Selection bits #pragma config WDTE = OFF // Watchdog Timer Enable bit #pragma config PWRTE = ON // Power-up Timer Enable bit #pragma config MCLRE = ON // RE3/~MCLR Pin Function Selection bit #pragma config CP = OFF // Code Protection bit #pragma config CPD = OFF // Data Code Protection bit #pragma config BOREN = ON // Brown Out Reset Selection bits #pragma config CLKOUTEN = OFF // Clock Out Enable bit #pragma config IESO = OFF // Internal External Switchover bit #pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enabled bit // Configuration Word Register 2 #pragma config WRT = OFF // Flash Memory Self Write Protection bit #pragma config PLLEN = ON // PLL Enable bit #pragma config STVREN = OFF // Stack Overflow/Underflow Reset Enable bit #pragma config BORV = HI // Brown-out Reset Voltage Selection bit #pragma config LVP = OFF // Low Voltage Programming Eanble bit void main(void) { OSCCON = 0b11110000; ANSELA = 0; TRISA = 0; ANSELB = 0; // 12F1822の場合はこの行は削除 TRISB = 0; // 12F1822の場合はこの行は削除 ANSELC = 0; // 12F1822の場合はこの行は削除 TRISC = 0; // 12F1822の場合はこの行は削除 /* while (1) のループを下記に変更 */ asm("movlb 2"); asm("loop1:"); asm("bsf LATA,1"); asm("bsf LATA,2"); asm("nop"); asm("nop"); asm("bcf LATA,1"); asm("bcf LATA,2"); asm("goto loop1"); }