美文网首页
C语言编程(定时器50ms)

C语言编程(定时器50ms)

作者: Myhighlight | 来源:发表于2019-04-28 11:23 被阅读0次

#include“reg52.h”  //头文件,包含各种寄存器定义及函数库

time0()      interrupt 1        using 0

{

    TH0=0x3C;TLO=0xB0;

    P1_0=~P1_0;

}

main()

{

      TMOD=0x01; TH0=0x3C;TLO=0xB0;

//12MHz下,50ms定时所对应的初值

      EA=1;ET0=1;TRO=1;

      while(1)

      {

        }

}

C语言编程(定时器50ms)

相关文章

网友评论

      本文标题:C语言编程(定时器50ms)

      本文链接:https://www.haomeiwen.com/subject/nkcdnqtx.html