LPC54102 Software Trigger DMA

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC54102 Software Trigger DMA

121 Views
rhsalced
Contributor I

Hello,

My goal is start/stop DMA transfers via software control. From the main loop I would like to start/stop DMA transfers.

The version of the SDK that I am using is v.3.04.000 and the example project is spis_dma. The reason for using this version is that I am working with legacy code that expects this version of the SDK. I am not planning on using the latest SDK and do not plan to.

From my understanding, I need to configure the DMA to be software trigger driven. From the UM10850 14.7.1 doc:

  • “CFGVALID and SV allows a more direct DMA block timing control by software”
    1. Are these set in the .xfercfg on lines 131, 138, 146, 153 or should they be set elsewhere?

 

  • ”Leaving a CFGVALID bit set to 0 allows the DMA sequence to pause at the description unit software triggers the continuation”
    1. How and where do I set this up?

 

  • “If a channel is configured with SWTRIG = 0, the channel can be later triggered either by hardware or software. Software triggering is accomplished by writing a 1 to the appropriate bit in the SETTRIG register”
    1. How and where do I set this register from the main loop?

 

  • “When a channel is initially set up, the SWTRIG bit in the XFERCFG register can be set, causing the transfer to begin immediately”

I am unsure if I am configuring the DMA to be software driven.

 Also, I don’t know what function/register I should call to start/stop the transfer. I’m calling the Chip_DMA_SetTrigChannel() function from the main loop, I don’t think I’m using this function correctly.

All that I am trying to do is set a DMA transfer once a second from the main loop via a software trigger. I could really use some help on how to do this.

The changes that I made to spis_dma.c

  • Set SPI as master
    1. Original project SPI was configured as slave. Set spiSetup.master = 1 on line 80.
  • Removed DMA_XFERCFG_RELOAD from xfercfg (lines 131, 138, 146, 153). I think I needed to do this so the DMA wouldn’t continuously execute.
  • Commented out spis_dma_Start(); from lines 189 and line 201.
  • In main, calling software dma trigger once a second. Lines 257- 258.

Any help on how to set up a software DMA trigger would be appreciated.

Thanks!

0 Kudos
Reply
0 Replies