关于51外部存储器地址问题:只用P0口做外部地址,怎么做到才不能影响到P2口的状态呢?我现在发现读取写入外部存储器,P2口的电平也在变化?怎么处理? #define base_Adr 0x00 unsigned char xdata *SJA_base_Adr = base_Adr; unsigned char CANREG_read(unsigned char SJAREG_ADR) { unsigned char SJAREG_data; SJAREG_data=*(SJA_base_Adr+SJAREG_ADR); return(SJAREG_data); }
void main(void) { unsigned int k; system_init(); for(;;) { CANREG_read(0x09);//这里就会影响P2口 } } |