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.

[参考译文] MSP-EXP430F5529LP:在 USCI_A1上设置 UART 的中断向量

Guru**** 2487425 points
Other Parts Discussed in Thread: MSP-EXP430F5529LP, MSP430F5529

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1221849/msp-exp430f5529lp-setting-up-interrupt-vector-for-the-uart-on-usci_a1

器件型号:MSP-EXP430F5529LP
主题中讨论的其他器件: MSP430F5529

大家好、在使用 gcc 进行编译的 MSP-EXP430F5529LP 板上、我将为计时器 B 和 USCI A 设置中断例程。我正在使用如下代码:

// USCI A1
__attribute__ ((interrupt(USCI_A1_VECTOR)))
void USCI_A1_ISR (void)
{
code
}

// TIMER B CC
__attribute__ ((interrupt(TIMER0_B0_VECTOR)))
void TIMER0_B0_ISR (void)
{
code
}

现在、当被编译时、代码具有:

Disassembly of section __interrupt_vector_60:

0000fff6 <__interrupt_vector_60>:
    fff6:       08 47           interrupt service routine at 0x4708

因此、它有一个针对计时器 B 的中断、但它不会为 USCI A 创建一个中断。我可以看到、这两个中断都在 msp430f5529.h 中定义

#define USCI_A1_VECTOR          (47)                     /* 0xFFDC USCI A1 Receive/Transmit */
#define TIMER0_B0_VECTOR        (60)                     /* 0xFFF6 Timer0_B7 CC0 */

我做错了什么、好像 USCI 中断代码只是被省略了-例如它没有拾取它的和中断例程。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Doah -愚蠢的编码错误-是 objdump 错误的文件!