打印

定时器仿真

[复制链接]
1406|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
chen3bing|  楼主 | 2007-7-25 18:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我正在学习2812,从网上载了一个小程序,定时器中断的.
可是运行时,发现定时器正常计数,但是不进中断.
请高手帮忙,多谢!
下面是主程序和中断程序:
#include "DSP281x_Device.h"     // DSP281x Headerfile Include File
#include "DSP281x_Examples.h"   // DSP281x Examples Include File

interrupt void cpu_timer0_isr(void);

void main(void)
{

   InitSysCtrl();

   DINT;

   InitPieCtrl();
   
   IER = 0x0000;
   IFR = 0x0000;


   InitPieVectTable();


   EALLOW;  // This is needed to write to EALLOW protected registers
   PieVectTable.TINT0 = &cpu_timer0_isr;
   EDIS;    // This is needed to disable write to EALLOW protected registers

   InitCpuTimers();   // For this example, only initialize the Cpu Timers

   ConfigCpuTimer(&CpuTimer0, 100, 1000000);
   StartCpuTimer0();

   IER |= M_INT1;


   PieCtrlRegs.PIEIER1.bit.INTx7 = 1;


   EINT;   // Enable Global interrupt INTM
   ERTM;   // Enable Global realtime interrupt DBGM


   for(;;




interrupt void cpu_timer0_isr(void)
{
   CpuTimer0.InterruptCount++;

      PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}

相关帖子

沙发
chen3bing|  楼主 | 2007-7-29 14:26 | 只看该作者

等待

有没有人知道啊?

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

438

主题

2520

帖子

2

粉丝