GPDMA Speed

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

GPDMA Speed

499 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Cusko on Mon Dec 09 08:10:47 MST 2013
Is it possible to set custom speed for GPDMA. I want to transfer from memory to DAC.
Thanks!
Labels (1)
0 Kudos
6 Replies

439 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Cusko on Fri Feb 14 05:50:19 MST 2014
Thanks for help.
0 Kudos

439 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Pacman on Sun Feb 02 00:33:33 MST 2014
vostro1000: How's the built-in DAC going to be targeted using the SGPIO ?
0 Kudos

439 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vostro1000 on Thu Jan 30 05:46:30 MST 2014
I think it's better to do a "custom" parallel interface using SGPIO interface so you can have a fifo and also use GPDMA with burst transfers then you should have better bandwith see nxp application notes  ;-)
0 Kudos

439 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Pacman on Wed Jan 29 09:28:07 MST 2014
Since you need it for audio only, you shouldn't have any problems with the speed. :)

Take a look at this thead I posted a while ago; it's a minimalistic example that shows how to set up the DMA and use it for outputting data to GPIO pins.

This is basically what needs to be done:
[list]
  [*]Turn on power for the DMA and the timer you will be synchronizing to.
  [*]Clear the timer's bit in the SYNC register (important: if bit is set, then you're not synchronizing)
  [*]Set up the DMA and the DMA channel (see the example for details)
  [*]Connect the DMA channel to the desired timer in the DMA channel's CONFIG register.
  [*]Disable the timer's interrupt in the NVIC.
  [*]Set up the timer.
  [*]Enable the timer's interrupt-bit, but do not enable the interrupt in the NVIC.
[/list]
Disabling the timer's interrupt in the NVIC allows the timer to trigger the DMA while avoiding that the timer's interrupt service routine is called. This is because both the DMA and the interrupt use the interrupt pending bit as triggers.

I've attached one of my (old) examples (for the LPC43xx), which blinks a LED using the DMA and the timer. It's not as good as the DMA example mentioned above, and the code has not been cleaned up for 'distribution', but you should be able to use it as a guide on how to do this. The LPC43xx and the LPC18xx are very similar, so there should be no difference in how to do this.

Since the LPC18xx does not have multiple cores, it might not have the GPDMA_DMACCxControl_SrcTransUseAHBMaster1 and GPDMA_DMACCxControl_DestTransUseAHBMaster1 bits. If not, you can safely ignore those and set them to 0. It's required on the LPC43xx though. (I use the 'aliases' GPDMA_SAHB1 and GPDMA_DAHB1 instead of the long names).

Although I've attached two header files, you should really only focus on the source code. The header files are just for reference.

The contents of the '#if 01' blocks can also be ignored. I've left them in there, so you can easily see how to diagnose any problems that might arise.
0 Kudos

439 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Cusko on Wed Jan 29 05:06:15 MST 2014
How did you synchronize DMA with timer?
I need it for audio only.
Thanks.
0 Kudos

439 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Pacman on Tue Jan 28 18:11:09 MST 2014
On the LPC43xx I managed to synchronize the DMA to a timer.
One problem I faced was that I could not get beyond a certain speed.
If you're trying to output audio, you're in luck; the speed will do fine.
If you're trying to output video, you may have to use a different approach.
Perhaps an NXP expert could interrupt and correct me here, if I'm wrong ?
0 Kudos