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.
您好!
使用具有 FIFO 的 SPI 时遇到问题。 我配置了 SPI (主器件、500kbit、16位大小)、我可以从 FIFO 发送数据、并看到我从逻辑分析仪上的 SPI 从器件 drv5383获得响应。
RXFIFO 似乎已填满、并且中断标志 RXFFINT 被置位。 但我的中断例程未被触发。
从技术参考指南中可以看到、对于 FIFO 操作、SPIINTENA 使能为0、这是对的吗?
rxFIFO 中断例程映射到 INT_SPIA_RX。
我正在将数据写入不在中断例程中的 txFIFO 中、这会导致问题吗?
谢谢!
弗洛里安
您好、Florian、
您的 SPI 配置看起来正常。 我认为问题可能出在 PIE 配置。 您能否分享有关该部分代码设置的更多详细信息? 作为参考、C2000ware 中提供了一个带有中断的 SPI FIFO 示例(请查看中的示例 \device_support\f2837xd\examples\cpu1\spi_loopback _interrupts\cpu01)
您好!
我用这个"C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2837xs+示例\CPU1\SPI\SPI_ex3_external_loopback_fifo_interrupts.c"作为应用程序的示例
现在、我在初始化中添加了:
IER |= M_INT6;
这将启用 PIE 中断。
现在调用 ISR 例程。 但在示例中、没有用于激活 PIE 中断的行。
driverlib 中是否有另一个用于激活 PIE 中断的函数?
谢谢!
弗洛里安
您好、Florian、
[引用 userid="476015" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1009413/tms320f28377s-spi-fifo-interrupts-are-not-triggered/3731523 #3731523"] driverlib 中是否有激活 PIE 中断的另一个函数?实际上、在您引用的该示例中、有几行用于启用中断。
// // Initialize PIE and clear PIE registers. Disables CPU interrupts. // Interrupt_initModule(); // // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // Interrupt_initVectorTable(); // // Interrupts that are used in this example are re-mapped to ISR functions // found within this file. // Interrupt_register(INT_SPIB_TX, &spibTxFIFOISR); Interrupt_register(INT_SPIA_RX, &spiaRxFIFOISR); .... // // Enable interrupts required for this example // Interrupt_enable(INT_SPIA_RX); Interrupt_enable(INT_SPIB_TX); .... // // Enable Global Interrupt (INTM) and realtime interrupt (DBGM) // EINT; ERTM;
您的代码是否进入了 ISR?
您好!
是的、代码现在进入 ISR。 我已经了解了函数"Interrupt_enable (INT_SPIA_RX);"应该启用 IER 位、但我不知道为什么不会发生这种情况、我必须手动执行。
谢谢!