This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR6972

Other Parts Discussed in Thread: MSP430FR6972, MSP430F423

我的贴子发出来很久了没有TI的工程师帮我回复解决关于用MSP430FR6972芯片及汇编语言编写程序在调试时遇到的问题,中断程序中无法跳出的问题,不知道怎样才能寻求到TI技术支持?产品延期很久了,因为是为了降低成本从MSP430F423芯片改用芯片FR6972,原来是汇编写的,在原来的基础上不想太多的改动,所以还是用汇编修改的,现在改C语言重写要花费很久时间,不知道咋办?
下面是简单的汇编实例,单步运行可以看到中断时事无法跳出中断程序的?

#include "msp430fr6972.h"
;-------------------------------------------------------------------------------
            RSEG    CSTACK                  ; Define stack segment
;-------------------------------------------------------------------------------
            RSEG    CODE
;-------------------------------------------------------------------------------
RESET         mov.w   #SFE(CSTACK),SP         ; Initialize stackpointer
StopWDT     mov.w   #WDTPW+WDTHOLD,&WDTCTL  ; Stop WDT
SetupGPIO   bis.b   #BIT0,&P1DIR
                      bis.b   #BIT0,&P1OUT
UnlockGPIO  bic.w   #LOCKLPM5,&PM5CTL0      ; Disable the GPIO power-on default
                                            ; high-impedance mode to activate
                                            ; previously configured port settings
                     mov.w   #CCIE,&TB0CCTL0         ; TBCCR0 interrupt enabled
                     mov.w   #50000,&TB0CCR0
                     mov.w   #TBSSEL__SMCLK+MC__UP,&TB0CTL ; SMCLK, UP mode
                      NOP
                     EINT
           
//            bis.w   #LPM0+GIE,SR            ; Enter LPM0 w/ interrupt
                      nop
MAIN:
            CALL        #DELAY_100mS
            JMP         MAIN
;--------------------------------------------------           
DELAY_100mS:
            MOV       #0100H,R6
DELAY_100mSLoop:           
            DEC       R6
            JNZ       DELAY_100mSLoop
            RET           
;------------------------------------------------------------------------------
TIMER0_B0_ISR;    Timer0_B7 CC0 Interrupt Service Routine
;------------------------------------------------------------------------------
            xor.b   #BIT0,&P1OUT
            reti
;-------------------------------------------------------------------------------
            COMMON  INTVEC                  ; Interrupt Vectors
;-------------------------------------------------------------------------------
            ORG     RESET_VECTOR            ; Reset Vector
            DW      RESET
            ORG     TIMER0_B0_VECTOR        ; Timer0_B7 CC0 Interrupt Vector
            DW      TIMER0_B0_ISR
            END

  • 不是ti的工程师,对汇编表示无能为力。

    建议先找一个官网的例程运行下,应该可以看到中间生成的汇编代码,你可以参考下

  • 谢谢你的回复,附加的例程就是TI官网的例子,只是修改了下进入中断时不是在睡眠状态。

  • nopMAIN:
    CALL #DELAY_100mS
    JMP MAIN


    There seems to be a mismatch between naming conventions specifically focusing on nopMAIN and MAIN, since there is no section of the code actually labeled MAIN I imagine that the JMP MAIN command fails to successfully loop as desired therefore the interrupt does not return where expected.

  • Susan Yang,

       谢谢你的回复,
    nopMAIN: 

                   CALL #DELAY_100mS
                   JMP MAIN

    这里是我复制错误,我原sourse

               #include "msp430fr6972.h"
    ;-------------------------------------------------------------------------------
                RSEG    CSTACK                  ; Define stack segment
    ;-------------------------------------------------------------------------------
                RSEG    CODE
    ;-------------------------------------------------------------------------------
    RESET       mov.w   #SFE(CSTACK),SP         ; Initialize stackpointer
    StopWDT     mov.w   #WDTPW+WDTHOLD,&WDTCTL  ; Stop WDT
    SetupGPIO   bis.b   #BIT0,&P1DIR
                bis.b   #BIT0,&P1OUT
    UnlockGPIO  bic.w   #LOCKLPM5,&PM5CTL0      ; Disable the GPIO power-on default
                                                ; high-impedance mode to activate
                                                ; previously configured port settings
                mov.w   #CCIE,&TB0CCTL0         ; TBCCR0 interrupt enabled
                mov.w   #50000,&TB0CCR0
                mov.w   #TBSSEL__SMCLK+MC__UP,&TB0CTL ; SMCLK, UP mode
                NOP
                EINT
                nop
    //            bis.w   #LPM0+GIE,SR            ; Enter LPM0 w/ interrupt
               
    MAIN:
                CALL        #DELAY_100mS
                JMP         MAIN
    ;--------------------------------------------------            
    DELAY_100mS:
                MOV       #0100H,R6
    DELAY_100mSLoop:            
                DEC       R6
                JNZ       DELAY_100mSLoop
                RET            
    ;------------------------------------------------------------------------------
    TIMER0_B0_ISR;    Timer0_B7 CC0 Interrupt Service Routine
    ;------------------------------------------------------------------------------
                xor.b   #BIT0,&P1OUT
                reti
    ;-------------------------------------------------------------------------------
                COMMON  INTVEC                  ; Interrupt Vectors
    ;-------------------------------------------------------------------------------
                ORG     RESET_VECTOR            ; Reset Vector
                DW      RESET
                ORG     TIMER0_B0_VECTOR        ; Timer0_B7 CC0 Interrupt Vector
                DW      TIMER0_B0_ISR
                END
    这例子是演示说明进入TIMER0_B0_ISR中断后就不能出来,我开发的产品程序代码太大,不能复制这里,但是出现问题是一样的进入定时中断里就不能出来。