#pragma config FOSC = INTRCCLK
#pragma config WDTE = OFF
#pragma config PWRTE = OFF
#pragma config MCLRE = ON
#pragma config BOREN = ON
#pragma config CP = OFF
#pragma config CPD = OFF
#include <xc.h>
int i = 0;
void main(void) { //Load Factory Calibration Value Into OSCCAL
asm("BSF STATUS, 5");
asm("CALL 3ffh");
asm("MOVWF OSCCAL");
asm("BCF STATUS, 5");
WPU = 0x00;
TRISIO = 0x00;
GPIObits.GPIO5 = 0;
while(1) {
for(i=0;i<100;i++)
{;}
GPIObits.GPIO5 = 1;
for(i=0;i<100;i++)
{;}
GPIObits.GPIO5 = 0;
}
return;
}
代码如上: GP4/CLKOUT 频率988kHz方波, GP5 频率只有259Hz.
不知道哪个寄存器还会影响指令周期? |