EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
51单片机(AT89C52)定时器" Y; C2 g% e5 r7 \- h: W
- G2 N4 [: D: ]( b
5 l/ z8 u2 Y, I5 b3 s- A2 i #include #define uchar unsigned char #define uint unsigned int uchar i,temp; void init() { TMOD=0x01; TH0=(65536-46080)/256; TL0=(65536-46080)%256; ET0=1; EA=1; TR0=1; } void main() { i=0; temp=0x01; init(); while(1); } void timer0() interrupt 1 { TH0=(65536-46080)/256; TL0=(65536-46080)%256; if(i<8) { P2=temp; i++; temp<<=1; } else { i=0; temp=0x01; } } ![]()
![]() . a. `3 O9 H8 ~( S5 y
|