首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

[求助]gz60 time base module 中断不工作,我的寄存器设置有问题吗?

[求助]gz60 time base module 中断不工作,我的寄存器设置有问题吗?

我是新手,我的gz60 time base module 中断不工作,LED没有动静,寄存器设置有问题吗?


看了好几天文档都没用,各位给个调试思路吧,先谢了


#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */


#define ON 0
#define OFF 1



#define LED1 PTF_PTF0
#define LED2 PTF_PTF1
#define LED3 PTF_PTF2
#define LED4 PTF_PTF3
#define LED5 PTF_PTF4
#define LED6 PTF_PTF5
#define LED7 PTF_PTF6
#define LED8 PTF_PTF7


#define  COUNT 75 /* Interrupts per sec */
unsigned char  cCounter=0x00; /* Interrupt Events Counter */



void main(void) {
 CONFIG1 = 0x0B;  
 CONFIG2 = 0x03;  


 DDRF  = 0xFF;  /* Configure PortF as Output */
 TF = 0x00;  /* Initialize PortF */
 
 TBCR  = 0x06;  


 cCounter = COUNT; /* Initialize the Counter */
 EnableInterrupts;


 TBCR_TBON=1;  /* Turn TBM on */
 while(1);  


}/* END main() */


 



interrupt 16 void TBM_ISR (void){


 TBCR_TACK=1;   /* TimeBase Interrupt Acknowledge */


 if( !(--cCounter) ){  /* If Counter is ZERO then */
    PTF = ~PTF;  /* Toggle LED */
    cCounter = COUNT;  /* Reinitialize the Counter */
 }
 
}/* END TBM_ISR() */

附件是CW08 V5.0 Project, TBM中断不工作,请斑主和高手过目呀
再发一次附件,是CW08 V5.0 Project, TBM中断不工作,请斑主和高手过目呀 http://bbs.eccn.com/uploadImages/testtime.zip
中断工作了,谢谢zhwdy81
是我的中断向量错了,不过freescale的文档MC68HC908GZ60.pdf里面41页写

IF16
$FFDC Timebase Vector (High)
$FFDD Timebase Vector (Low)

这样应该用中断向量16还是17?
文档理解不了

再谢zhwdy81
返回列表