#include <reg52.h>
sbit P11=P1^1;
void main( )
{
TMOD = 0x01;
TH0=(65536-10000)/256;
TL0=(65536-10000)%256;
TR0=1;
while(1);
}
void InterruptTimer0( ) interrupt 1
{
static unsigned char count = 0;
TH0=(65536-10000)/256;
TL0=(65536-10000)%256;
if(count<10)
{
count++;
}
else
{
count =0;
P11=~P11;
}
}
51单片机:使用晶振频率为6MHz作为时钟源,定时器T0工作在方式1,编程实现:P1.1引脚上输出周期为200ms的等宽正方波连续脉冲信号,要求以中断方式完成。
最新推荐文章于 2022-12-09 16:23:43 发布