單片機基礎(chǔ)程序練習題
答:
(1)
sfr T2CON=0xc8;
sfr T2MOD=0xc9;
sfr RCAP2L=0xca;
sfr RCAP2H=0xcb;
sfr TL2=0xcc;
sfr TH2=0xcd;
(2)
sbit CP_RL2=T2CON^0;
sbit C_T2=T2CON^1;
sbit TR2=T2CON^2;
sbit EXEN2=T2CON^3;
sbit TCLK=T2CON^4;
sbit RCLK=T2CON^5;
sbit EXF2=T2CON^6;
sbit TF2=T2CON^7;
(3)
sbit T2=P1^0;
sbit T2EX=P1^1;
sbit ET2=EI^5;
sbit PT2=IP^5;
(4)
sbit P0_0=P0^0;
sbit P0_1=P0^1;
sbit P0_2=P0^2;
sbit P0_3=P0^3;
sbit P0_4=P0^4;
sbit P0_5=P0^5;
sbit P0_6=P0^6;
sbit P0_7=P0^7;
評論