打印

timer1进不了中断

[复制链接]
684|9
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
zhanghqi|  楼主 | 2014-12-29 20:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
zhenykun| | 2014-12-29 20:17 | 只看该作者
设置中断向量表的程序看看

使用特权

评论回复
板凳
zhanghqi|  楼主 | 2014-12-29 20:21 | 只看该作者

*
*---------vecs_timer1.asm---------
*
* Assembly file to set up interrupt service table (IST)
*

*------------------------------------------------------------------------------
* Global symbols defined here and exported out of this file
*------------------------------------------------------------------------------
.global _vectors
.global _c_int00
.global _vector1
.global _vector2
.global _vector3
.global _vector4
.global _vector5
.global _vector6
.global _vector7
.global _vector8
.global _vector9
.global _vector10
.global _vector11
.global _vector12
.global _vector13

.global _vector14
.global _extint7_isr ; Hookup the c_int14 ISR in main()
*------------------------------------------------------------------------------
* Global symbols referenced in this file but defined somewhere else.
* Remember that your interrupt service routines need to be referenced here.
*------------------------------------------------------------------------------
.ref _c_int00
.ref _extint14_isr ; external interrupt INT 7 handler
*------------------------------------------------------------------------------
* This is a macro that instantiates one entry in the interrupt service table.
*------------------------------------------------------------------------------
VEC_ENTRY .macro addr
STW B0,*--B15
MVKL addr,B0
MVKH addr,B0
B B0
LDW *B15++,B0
NOP 2
NOP
NOP
.endm


*------------------------------------------------------------------------------
* This is a dummy interrupt service routine used to initialize the IST.
*------------------------------------------------------------------------------
_vec_dummy:
B B3
NOP 5

*------------------------------------------------------------------------------
* This is the actual interrupt service table (IST). It is properly aligned and
* is located in the subsection .text:vecs. This means if you don't explicitly
* specify this section in your linker command file, it will default and link
* into the .text section. Remember to set the ISTP register to point to this
* table.
*------------------------------------------------------------------------------
.sect ".vectors"
;.align 1024

_vectors:
_vector0: VEC_ENTRY _c_int00 ;RESET
_vector1: VEC_ENTRY _vec_dummy ;NMI
_vector2: VEC_ENTRY _vec_dummy ;RSVD
_vector3: VEC_ENTRY _vec_dummy
_vector4: VEC_ENTRY _vec_dummy
_vector5: VEC_ENTRY _vec_dummy
_vector6: VEC_ENTRY _vec_dummy
_vector7: VEC_ENTRY _vec_dummy
_vector8: VEC_ENTRY _vec_dummy
_vector9: VEC_ENTRY _vec_dummy
_vector10: VEC_ENTRY _vec_dummy
_vector11: VEC_ENTRY _vec_dummy
_vector12: VEC_ENTRY _vec_dummy
_vector13: VEC_ENTRY _vec_dummy
_vector14: VEC_ENTRY _vec_dummy

_vector15: VEC_ENTRY _extint14_isr ; Hookup the c_int14 ISR in main()

*------------------------------------------------------------------------------

然后在主程序中设置了

IER=1; /* disable all interrupts except NMI */
ICR=0xffff; /* clear all pending interrupts */
ISTP = 0x10800400;
INTC_EVTCLR0 = 0xFFFFFFFF;
INTC_EVTCLR1 = 0xFFFFFFFF;
INTC_EVTCLR2 = 0xFFFFFFFF;
INTC_EVTCLR3 = 0xFFFFFFFF;
INTC_EVTMASK3 = 0xFFFFFFFF;
INTC_EVTMASK2 = 0xFFFFFFFF;
INTC_EVTMASK1 = 0xFFFFFFFF;
INTC_EVTMASK0 = 0xFFFFFFEF;
INTC_INTMUX3 = 0x00040000;
IER |= 0x00008002;
并编写了中断程序interrupt void extint14_isr(void)

现在进不去中断程序,请各位大神赐教啊!!

使用特权

评论回复
地板
wyjie| | 2014-12-29 20:22 | 只看该作者
你用的什么?

使用特权

评论回复
5
zhanghqi|  楼主 | 2014-12-29 20:22 | 只看该作者
我用的DM6437

使用特权

评论回复
6
jlyuan| | 2014-12-29 20:22 | 只看该作者
没进中断处理的原因很多,很可能是没有使能

使用特权

评论回复
7
jlyuan| | 2014-12-29 20:22 | 只看该作者
或是定时器1的中断号与中断处理程序不匹配。

使用特权

评论回复
8
yszong| | 2014-12-29 20:23 | 只看该作者
看看mask位是否设置。

使用特权

评论回复
9
zhanghqi|  楼主 | 2014-12-29 20:23 | 只看该作者
嗯,我检查一下,多谢啊

使用特权

评论回复
10
zhanghqi|  楼主 | 2014-12-29 20:23 | 只看该作者
那就先结贴了哈,晚安

使用特权

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

本版积分规则

852

主题

11757

帖子

5

粉丝