虽然简单,但对于初学者还是有一定的帮助。
#define Bank0 INSCON &= 0xbf
#define Bank1 INSCON |= 0x40
Bank0;
//Bank0内操作
P0 =Bin(10000100);
P0CR =Bin(10000100);//0为输入 ,1为输出
P0PCR = Bin(01000000);//上拉
P0 =Bin(10000100);
//Bank1内操作
Bank1 ;
P5 =0x00 ;
P5CR =Bin(00000011);//0为输入 ,1为输出
P5PCR = Bin(00000000);//0为输入 ,1为输出
Bank0 ;
原文地址:http://blog.csdn.net/chuangwu2009/article/details/30265285