DMA SPI and K20 PUSHR Register

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

DMA SPI and K20 PUSHR Register

901件の閲覧回数
gvalvo
Contributor I

Hi all. I have DMA-driven SPI transfers mostly working on the MK20DX256. There's only one issue that I can't resolve:

 

My observation is that 32-bit writes to the 'SPIx_PUSHR' register properly write the Control Word (upper half) and TXDATA (lower half).  However, subsequent 8 or 16-bit writes to PUSHR don't preserver the previous Control Word when they set the TXDATA field. Rather, it appears that these writes cause the Control Word to be set to 0x0000. Put another way, the Control Word is not "sticky".

 

First, is my observation correct? If so, it means that subsequent 8 or 16-bit DMA operations (after an initial 32-bit programmatic write) will result in 0x0000 for the Control Word.

 

This behavior causes 2 issues. The first is easy to handle, just make sure CTAR0 is properly set with your desired SPI configuration parameters. The second is that it's impossible to have the 'CONT' bit set in the control word for DMA transfers. This means that there is an unneeded Tdt delay added between every transfer, slowing down the whole process.

 

The only solution I've come up with so far is to make the DMA writes all 32 bits and include the desired Control Word in every one. But, this is horribly wastefull of memory as it requires the DMA buffer to be 2 X (16-bit SPI transactions) or 4 X (8-bit SPI transactions) larger than it needs to be.

 

So, anyone know if there's a way to make the PUSHR Control Word field "sticky".

 

Thanks in advance.

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 返信

716件の閲覧回数
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Please check below thread about similar discussion:

https://community.nxp.com/message/378836?commentID=378836#comment-378836 

Wish it helps.


Have a great day,
Mike

-------------------------------------------------------------------------------
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 件の賞賛
返信