MK64 SPI DMA Receive in Master mode - Impossible?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MK64 SPI DMA Receive in Master mode - Impossible?

1,023 次查看
eyaldoron
Contributor II

In the K64, SPI1 and SPI2 have only a single DMA trigger source. As far as I can see, this means you can't operate both a transmit and a receive DMA at the same time. In particular, this means that a DMA receive in Master mode is impossible, since it always requires a transmit channel. Is this true? It seems like a significant step back from, say, the K60, where all SPI channels have separate TX and RX DMA triggers.

Any workaround, except to use polling or interrupts?

Thanks,

Eyal Doron

0 项奖励
回复
2 回复数

763 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Eyal,

According to the reference manual, the SPI1 and SPI2 only support one trigger source at the same time, then it means that it's unable to transfer the data through the DMA mechanism.

And I'd like to suggest that you can choose the interrupt to instead of the DMA.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

763 次查看
eyaldoron
Contributor II

Its been a long time, but I found a sort of solution

For transmit I now use a DMA channel triggered from a timer, instead of from the SPI peripheral. This works since the SPI timing is deterministic. The only disadvantage, except for locking down a timer, is that the transfer is slightly slower since I allow some slack

0 项奖励
回复