我用的板子接入电脑,能识别为REALTEK ISP设备,也能用CYCONSOLE来download编译后的C51程序.可是为什么不能让接在PA6,PA7的LED灯闪烁呢?程序如下,欢迎指导.谢过. #include "reg52.h"
unsigned int count,count1,count2,count3; xdata volatile unsigned char IFCONFIG _at_ 0xE601; // Interface Configuration xdata volatile unsigned char PORTACFG _at_ 0xE670; // I/O PORTA Alternate Configuration sfr OEA=0xb2; main() { void LedLight(); void LedOff();
IFCONFIG=0x80; PORTACFG=0; OEA=0xc0;
while(1) { LedOff(); LedLight(); LedOff(); LedLight();
LedOff(); LedLight(); }
}
void LedLight() { P0=0x3f; for(count=0;count++;count<64000) { for(count1=0;count1++;count1<60000) { } } }
void LedOff() { P0=0xff; for(count=0;count++;count<64000) { for(count1=0;count1++;count1<60000) { } } }
|