AnsweredAssumed Answered

K64: How to Initiate 2-frame SPI transfer from DMA?

Question asked by Dave Nadler on Jan 12, 2017
Latest reply on Jan 30, 2017 by Dave Nadler

As part of a set of DMA processing that generates various excitation and control signals, we need to initiate an SPI master transfer of two 16-bit words. The SPI slave device actually has a single 18-bit frame, so we'll just use two 16-bit frames from K64 (16-bit is maximum length K64 SPI supports for master transfer), and ignore the extra 14 bits clocked in on receive.

 

First try: SPI2 has a 1-deep FIFO, and the documentation implies that a frame is immediately moved from FIFO to shift register if you write to PUSHR while SPI is not running (while shift register is empty). So, I though just use DMA to write two 32-bit words to PUSHR (first should immediately transfer into shift register, second sits in FIFO til first is shifted out). Unfortunately, 2nd word is ignored and I only see one 16-bit transfer on the scope, aarrggg... Note: SPI DMA request is used to transfer RX data into a buffer; this part works OK (except only first 16-bits of data ever received).

 

So, how to start a two-word transfer to SPI via DMA (no ISRs etc, DMA only)?

 

Thanks in advance for any help,
Best Regards, Dave

Outcomes