bokee.net

电子/电气工程师博客

正文 更多文章

注意F2407REGS.H文件中的错误

                                             注意F2407REGS.H文件中的错误

 

                                                        王佰营    徐丽红

 

                                                  wbymcs51.blog.bokee.net

TMS320LF2406的定时器4调试中,发现周期中断程序只执行一次;查了五天,一直没有结果;实在没办法就用相同功能的指令组替换原指令组,更换到以下指令时问题解决了:

原指令组: ldp         #EVBIFRB>>7

                     lacl         EVBIFRB

                     sacl        EVBIFRB

新指令组: ldp         #DP_EVB

                     splk       #0001h,                 EVBIFRB

结果问题的根源在F2407REGS.H文件中:

 

; Originator:   Texas Instruments

;

; Description:  F240 Header file containing all peripheral register

;                    declarations as well as other useful definitions.

;

; Last Updated:   27 May 1997

;

;***********************************************************************

 

;-----------------------------------------------------------------------

; On Chip Periperal Register Definitions (All registers mapped into data

; space unless otherwise noted)

;-----------------------------------------------------------------------

 

;Global memory and CPU interupt Registers

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IMR        .set  0004h                   ;Interrupt Mask Register

GREG     .set  0005h                   ;Global memory allocation Register

IFR         .set  0006h                   ;Interrupt Flag Register

 

;System Registers

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PIRQR0         .set  07010h

PIRQR1         .set  07011h

-----------------------------------------------------------------

; Event Manager (EVB) Interrupt Control Registers

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EVBIMRA            .set  742Ch                  ;EV Interrupt Mask Register A

EVBIMRB            .set  742Dh                  ;EV Interrupt Mask Register B

EVBIMRC            .set  742Eh                   ;EV Interrupt Mask Register C

EVBIFRA             .set  742Fh                   ;EV Interrupt Flag Register A

EVBIFRB             .set  7430h                   ;EV Interrupt Flag Register B

EVBIFRC             .set  7431h                   ;EV Interrupt Flag Register C

 

---------------------------------------------

;Frequently Used Data Pages

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DP_B2               .set 0                     ;page 0 of data space

DP_B01             .set  4                    ;page 4 of B0(200H/80H)     

DP_B02             .set  5                    ;page 5 of B0(280H/80H)     

DP_B11             .set  6                    ;page 6 of B1(300H/80H)     

DP_B12             .set  7                    ;page 7 of AD(380H/80H)    

DP_SARAM1    .set  16                  ;page 1 of SARAM(800h/80h)

DP_SARAM2    .set  17                  ;page 2 of SARAM(880h/80h)

DP_SARAM3    .set  18                  ;page 3 of SARAM(900h/80h)

DP_SARAM4    .set  19                  ;page 4 of SARAM(980h/80h)

DP_PF1             .set 224                 ;page 1 of Peripheral Frame1 file (7000h/80h)(0XE0)

DP_PF2             .set 225                 ;page 2 of Peripheral Frame1 file (7080h/80h)(0XE1)

DP_CAN           .set 226                 ;page 3 of Peripheral Frame1 file (7100h/80h)(0XE2)

DP_PF4             .set 227                 ;page 4 of Peripheral Frame1 file (7080h/80h)(0XE3)

DP_CAN2         .set 228                 ;page 5 of Peripheral Frame1 file (7200h/80h)(0XE4)

DP_EVA            .set  232                ;page 0 of Event Manager-EVA file (7400h/80h)(0xE8)

;DP_EVB            .set  234                ;page 0 of Event Manager-EVB file (7500h/80h)(0xE9)

 更改:(谢谢sprindy朋友发现此问题)

DP_EVB            .set  234                ;page 0 of Event Manager-EVB file (7500h/80h)(0xEA)

 

看上边加粗的部分应改为:

EVBIMRA            .set  752Ch                  ;EV Interrupt Mask Register A

EVBIMRB            .set  752Dh                  ;EV Interrupt Mask Register B

EVBIMRC            .set  752Eh                   ;EV Interrupt Mask Register C

EVBIFRA             .set  752Fh                   ;EV Interrupt Flag Register A

EVBIFRB             .set  7530h                   ;EV Interrupt Flag Register B

EVBIFRC             .set  7531h                   ;EV Interrupt Flag Register C

    许多参考书都存在这个问题;F2407REGS.H文件的其他地方暂时未发现错误。

 

分享到:

上一篇:单端反激式开关电源磁芯尺寸和类型的选

下一篇:简单、友好的按键处理程序设计

评论 (2条) 发表评论

  • wby
    wby : 谢谢这位sprindy朋友。

    2011-01-10 11:05

  • sprindy (游客) : 最后一句: DP_EVB .set 234 ... (7500h/80h)(0xE9) 应改为: DP_EVB .set 234 ... (7500h/80h)(0xEA)

    2011-01-09 18:53

发表评论
验证码