tags:

views:

53

answers:

1

I am new to embedded devices programing. I have a task that reads a block of data from the DSP memory address and copies it to other addresses (where other peripherals are mapped). the copying process is done by programming one of the DMA channels in the device. I would like, to have a copy of that data copied elsewhere in addition for the first copy.

now my question is, if I use a second DMA channel and trigger its copy operation on right after the first DMA start doing its job, would the two DMA operations collide with each other in some way ?

+4  A: 

Depends, I'm sure, on what your doing this on, but no, the DMA channels will not likely 'collide' though one may preempt the other.

If you're using this on one of Microchips dsPIC33F devices, the point of the DMA is that the access is independent of the CPU. If you time it right, then you can match your DMA timing to your clock timing and get atomic reads or writes. Also, you could have up to 8 unidirectional channels, that are ordered in priority.

On that platform, I believe, (I don't know) that two DMA channels will not operate simultaneously, they will operate one after the other, based on that particular channels' priority. The higher priority channel will finish first, even if the lower priority channel started first.

So, yes, you can copy your information to two different locations without using up CPU clocks, but it will take twice as long.

ArielP