我89C52的P0口怎么一点反应都没有呢? #define _TEST_C_ #include "reg52.h" #include "stdlib.h" #include "absacc.h" #include "intrins.h" #include "test.h"
#define uchar unsigned char #define uint unsigned int #define COM8251 XBYTE[0x8601] #define DAT8251 XBYTE[0x8600] sbit flag1_8251 = ACC^0; sbit flag2_8251 = ACC^1; uchar data_temp[10]={0xAA,10,22,32,0,0};
void initmcu(void); void Trans8251(void);
void main(void) { initmcu(); Trans8251(); } void initmcu(void) { TMOD = 0x22; //9600波特11.0592MHz,方式2 TL1 = 0XFD; TH1 = 0XFD;SCON = 0X50; TR1 = 1; TR0=1; ES = 1; EA = 1; }
void Trans8251(void) { uchar i; COM8251 = 0x00; COM8251 = 0x00; COM8251 = 0x00; COM8251 = 0x40; COM8251 = 0x6d; COM8251 = 0x37; for(;;) { for(i=0;i<4;i++) do ACC = COM8251; while(flag1_8251==0); DAT8251 = data_temp; } }
|