打印

我的DSP 之路

[复制链接]
1674|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
GXK82820|  楼主 | 2008-6-24 17:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
DSP, AD, AN, pi, CAN

原文作者:chenxkj  **来源于:DSP交流网
中断向量表的编写
    .ref    _bad_trap    ; 这个标号外部没有定义,为什么还用.ref,而不是用..global?
        .ref           _c_int0     ; entry point to the code
.sect        "vectors"                                ;自定义段名
_vector:                                                 ;向量表地址标识
RSVECT    B    _c_int0    ;_c_int0复位程序入口地址
INT1                  B    _bad_trap        ;没有用到的中断跳转到非法中断陷阱
INT2        B    _bad_trap        ;前面的标号INT2只是为了让人更容易理解是这是什
                                        ;么中断的向量,还是有其它的什么用处?
INT3                  B    PM6                ;有用到的中断,则写其实际中断的地址或标号
INT4                  B    _bad_trap        ; PM 8        Int level 4                7
INT5                  B    _bad_trap        ; PM A        Int level 5                8
INT6                  B    _bad_trap        ; PM C        Int level 6                9
…….
        .end   

PAGE 0 :                                         /* program memory */
          VECS: origin = 00000h, length = 0007Fh

vectors   :          > VECS PAGE = 0

这样就可以正确装入中断向量表

CPU中断向量地址和外设中断向量PIV有什么不同?什么是外设中断向量PIV?
中断的优先级是否固定不可变,还是说书中列出的是默认的优先级?
ADC、外部引脚、SPI、SCI、CAN邮箱、CAN错误有高低优先级选择,其它的优先级固定。
为什么同一个中断源里的中断还有不同的中断优先级?进的是同一个中断程序,不同优先级有什么作用?

2008-2-27
按例子改的lf2406a中断向量表:
;  ssembly language code, vectors for test code on TMS320C2406
;  filename:        Vectors.asm                                                   */
;  original:        02/27/2008   by: CQ                                                   */
;  last update: 02/27/2008   by: CQ                                                      */                                                                

    .ref    _bad_trap   ; illegal trap
        .ref           int0     ; entry point to the code

        .global        _vector
                            ; also check the conditional compile in
                            ; scidrv.c and scidrv.h
        .sect        "vectors"
_vector: 
RSVECT      B    int0             ;复位

INT1                  B    _bad_trap        ; 外部中断1
                                                        DPINTA         EVA功率驱动保护引脚中断
                                                        DPINTB         EVB功率驱动保护引脚中断
                                                        ;ADCINT                高优先级 
                                                        ;XINT1                高优先级
                                                        ;XINT2                高优先级 外部引脚中断
                                                        ;SPIINT                高优先级
                                                        ;RXINT                 高优先级 SCI接收中断
                                                        ;TXINT                 高优先级 SCI发送中断
                                                        ;CANMBINT        高优先级 CAN邮箱中断        
                                                        ;CANERINT        高优先级 CAN错误中断                                                                        
INT2                  B    _bad_trap        ;外部中断1
                                                        ;CMP1INT                         比较器中断
                                                        ;CMP2INT
                                                        ;CMP3INT
                                                        ;TIPINT                                 定时器1周期中断
                                                        ;T1CINT                                 定时器1比较中断
                                                        ;T1UFINT                         定时器1下溢中断
                                                        ;T1OFINT                         定时器1上溢中断
                                                        ;CMP4INT
                                                        ;CMP5INT
                                                        ;CMP6INT
                                                        ;T3PINT
                                                        ;T3CINT
                                                        ;T3UFINT
                                                        ;T3OFINT                

INT3                  B    _bad_trap        ;外部中断3
                                                        ;T2PINT
                                                        ;T2CINT
                                                        ;T2UFINT
                                                        ;T2OFINT
                                                        ;T4PINT
                                                        ;T4CINT
                                                        ;T4UFINT
                                                        ;T4OFINT                

INT4                  B    _bad_trap        ;外部中断4
                                                        ;CAP1INT        捕获中断1
                                                        ;CAP2INT
                                                        ;CAP3INT
                                                        ;CAP4INT
                                                        ;CAP5INT
                                                        ;CAP6INT

INT5                  B    _bad_trap        ;外部中断5
                                                        ;SPIINT                低优先级
                                                        ;RXINT                 低优先级 SCI接收中断
                                                        ;TXINT                 低优先级 SCI发送中断
                                                        ;CANMBINT        低优先级 CAN邮箱中断
                                                        ;CANERINT        低优先级 CAN错误中断
                                                                                                                                                                        
INT6                  B    _bad_trap        ;外部中断6
                                                        ;ADCINT                低优先级 
                                                        ;XINT1                低优先级 外部引脚中断
                                                  ;XINT2                低优先级 外部引脚中断

RESERVED    B    _bad_trap  ;保留,分析中断用
SW_INT8           B    _bad_trap        ;软件中断8~16
SW_INT9           B    _bad_trap        ;
SW_INT10          B    _bad_trap        ;
SW_INT11          B    _bad_trap        ;
SW_INT12          B    _bad_trap        ;
SW_INT13          B    _bad_trap        ;
SW_INT14          B    _bad_trap        ;
SW_INT15          B    _bad_trap        ;
SW_INT16          B    _bad_trap        ;
TRAP                  B    _bad_trap        ;TRAP指令中断
NMI                        B    _bad_trap        ;不可屏蔽软中断
EMU_TRAP          B    _bad_trap        ;用于仿真
SW_INT20          B    _bad_trap        ;软件中20~31
SW_INT21          B    _bad_trap        ;
SW_INT22          B    _bad_trap        ;
SW_INT23          B    _bad_trap        ; 
SW_INT24          B    _bad_trap        ;
SW_INT25          B    _bad_trap        ;
SW_INT26          B    _bad_trap        ;
SW_INT27          B    _bad_trap        ;
SW_INT28          B    _bad_trap        ;
SW_INT29          B    _bad_trap        ;
SW_INT30          B    _bad_trap        ;
SW_INT31          B    _bad_trap        ;
        .end
转载请注明出自DSP交流网 DSP学习第一论坛 DSP技术应用与推广平台 DSP开发服务平台 http://www.hellodsp.com/bbs/,本贴地址:http://www.hellodsp.com/bbs/viewthread.php?tid=6826



相关帖子

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

本版积分规则

2

主题

4

帖子

0

粉丝