• 已解决 73482 个问题
  • 已帮助 5993 位优秀工程师

求DM6437上能运行的定时器程序?

franki 2016-11-30 浏览量:1463

如题,求DM6437上能运行的定时器程序? 如果能在seed-DEC7437上运行那最好不过啦。

谢谢啦 !

0 0 收起

我来回答

上传资料:
选择文件 文件大小不超过15M(格式支持:doc、ppt、xls、pdf、zip、rar、txt)
最佳答案
  • 配置定時器的話可以參考以下Code

    /*set 1us unit times*/
    void timer0_init(Uint32 times)
    {
    
        TIMER0_TGCR = 0;
        TIMER0_EMUMGT = 0x0003;
        TIMER0_TIM12 = 0;
        TIMER0_TIM34 = 0;
        TIMER0_PRD12 = times * 27;  // 1us
        TIMER0_PRD34 = 0;
        TIMER0_TGCR = (0 << 2) |//TIMMODE 64bit GP Timer
                                 (1 << 1) | //TIMER0 3:4 no reset
                                 (1 << 0); // TIMER0 1:2 no reset
        
        TIMER0_TRC = (0 << 22) |
                               (0 << 8) |   //internal clock
                               (0 << 6) ;  //one-time mode disable
                              
    }
    
    
    void  start_timer0()
    {
    
        TIMER0_TRC |= (1 << 6);
    
    }
    
    void stop_timer0()
    {
        
        TIMER0_TRC ^= (1 << 6); //disable the timer0.
        TIMER0_TIM12 = 0;
        TIMER0_TIM34 = 0;// clear count value
    
    }
    以上希望有幫助到您

    • 发布于 2016-11-30
    • 举报
    • 评论 0
    • 0
    • 0

其他答案 数量:2
  • http://www.pudn.com/downloads396/sourcecode/embedded/detail1694591.html
    • 发布于2016-11-30
    • 举报
    • 评论 0
    • 0
    • 0

  • http://blog.csdn.net/gzzaigcnforever/article/details/16971181,下面还有一些说明 ,可以看看。


    • 发布于2016-12-01
    • 举报
    • 评论 0
    • 0
    • 0

相关问题

问题达人换一批

求DM6437上能运行的定时器程序?