使用C8051F340外部晶振,配置之后,用EC6单步调试,程序直接卡住,KEIL退不出来,需要ALT+CTRL+'.'
请问是我板子的事么,程序如下:
#include<c8051f340.h>
// Peripheral specific initialization functions,
// Called from the Init_Device() function
void Port_IO_Init()
{
P0MDIN = 0x3F; //6,7模拟输入
P0SKIP = 0xC0;
P4MDOUT = 0x20;
XBR1 = 0x40;
}
void Oscillator_Init()
{
int i = 0;
OSCXCN = 0x67;
for (i = 0; i < 3000; i++); // Wait 1ms for initialization
while ((OSCXCN & 0x80) == 0);
OSCICN = 0x00;
CLKSEL = 0x01;
}
// Initialization function for device,
// Call Init_Device() from your main program
void Init_Device(void)
{
Port_IO_Init();
Oscillator_Init();
}
void main()
{
PCA0MD &= ~0x40;
Init_Device();
while(1)
{
P4 &=~(1<<5); // LED
}
} |