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.

F28377 SPI using DMA

Genius 12760 points

Other Parts Discussed in Thread: CONTROLSUITE

For the F28377 customer would like to transmit SPI data using the DMA. The transmission should approximately look like the picture below. There are two exceptions:

    1. Instead of 8 bit we will transmit 16 bit per character.
    1. There is  no need of an inter-word timeout.


Further there frame length of a DMA frame is fixed.

 
 

Is there any way to configure the DMA to suffice these requirements, e.g.

    • While receiving, start a DMA transfer on CS falling edge.
    • Keep receiving word by word until the fixed length frame is finished.

-> Sounds like having two triggers at a time for DMA.
The data in memory will be periodically (not on ISR) read by the consumer.

    • While sending generating the CS. Of course we could clear the CS while setting up the DMA and have an end DMA interrupt. But we would prefer the DMA to set the CS after TRANSFER end.


I would appreciate every hint.

Regards,

Bernd

  • Bernd,

    Please refer to the spi_loopback_dma example in controlSUITE. This example shows the necessary steps to configure the SPI for DMA transfers in master mode. The customer will need to adjust the burst and transfer sizes as necessary. For transmitting, one DMA channel will copy from memory to SPITXBUF. For receiving, another DMA channel will be configured to copy the received data from SPIRXBUF to the memory to be read later. The SPI signals will toggle no differently than during a regular SPI frame. This means that if the SPI is the master, the chip select will stay asserted until there is no more data to be transmitted. If the SPI is the master, as long as the chip select is active, and there is incoming data, the SPI will receive it. If the DMA is configured appropriately, the data will be copied to the memory for storage.

    Thanks,
    Mark