RT1021 LPSPI DMA in Quad mode

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

RT1021 LPSPI DMA in Quad mode

跳至解决方案
2,088 次查看
nda
Contributor III

Hello. Does anybody knows how to use DMA in LPSPI in Quad mode. I can understand how i can do that. Is it possible to use quad mode with DMA? I ask this because i need to set LPSPI_TCR[TXMSK] for reception, but when i do that module starts transmitting and resets LPSPI_TCR[TXMSK] automaticaly before starting DMA.

标签 (4)
标记 (3)
0 项奖励
回复
1 解答
2,058 次查看
nda
Contributor III

Now i can answer the question. It is possible to use LPSPI in Quad mode with DMA. It is necessary to rewrite LPSPI_MasterTransferEDMA to configure DMA to write to TCR instead of TDR. Dont forget to change transfer size to 4 Bytes, because the Command Register should only be written using 32-bit writes. CFGR1 also should be changed accordingly.

Nevertheless quad mode doesnot helped me to increase transfer baubrate. Maximum throughput stays on the limit of 30megabit per second. If am using Quad mode and 30MHz Spi clock there are sugnificant delays in transmissions :(. So Quad mode helps to reduce clock of SPI and doesnot help to increase baudrate. 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,080 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1)Is it possible to use quad mode with DMA?
-- Yes, and in my opinion, essentially, it's no difference between single-data SPI and quad-data SPI transfer via the DMA way.
Have a great day,
TIC

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复
2,075 次查看
nda
Contributor III

Hello,  jeremyzhou.

There is big difference in single-data SPI and quad-data SPI receive. In case of single-data SPI receive i need to write to TDR register to start transmission, while in quad-data SPI receive i need to set TCR[TXMSK](any write to TDR will start transmission, not receiving ). So my question - how to !receive! data using DMA  in quad-data mode.

0 项奖励
回复
2,066 次查看
jeremyzhou
NXP Employee
NXP Employee

Thanks for your reply.
After confirming, 4-bit half-duplex transfers are useful for interfacing to QuadSPI memory devices, and at least one bit (Transmit Data
Mask (TCR[TXMSK] or Receive Data Mask TCR[RXMSK]) must
also be set.
However, when set TCR[RXMSK]), receive data is not stored in receive FIFO, and according to Table 47-10. LPSPI Interrupts and DMA Requests, the mechanism is unable to trigger the DMA request.

jeremyzhou_0-1616989781623.png

 


Sorry for the previous reply bring inconvenience to you.
Have a great day,
TIC

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复
2,059 次查看
nda
Contributor III

Now i can answer the question. It is possible to use LPSPI in Quad mode with DMA. It is necessary to rewrite LPSPI_MasterTransferEDMA to configure DMA to write to TCR instead of TDR. Dont forget to change transfer size to 4 Bytes, because the Command Register should only be written using 32-bit writes. CFGR1 also should be changed accordingly.

Nevertheless quad mode doesnot helped me to increase transfer baubrate. Maximum throughput stays on the limit of 30megabit per second. If am using Quad mode and 30MHz Spi clock there are sugnificant delays in transmissions :(. So Quad mode helps to reduce clock of SPI and doesnot help to increase baudrate. 

0 项奖励
回复