Hi,
I have used the example code you supplied and it works fine. Then I have tried to adapt it to send more data but it does not behave as expected. I have allocated to arrays:
char source[128];
char destination[128];
Then I set the source destination registers like this:
DMA_TCD0_SADDR = (uint_32)source;
DMA_TCD0_DADDR = (uint_32)destination;
When I try to copy the data, more data is copied than what I want. For instance, if I set registers like this:
DMA_TCD0_SOFF = 0x04;
DMA_TCD0_ATTR = DMA_ATTR_SSIZE(2) | DMA_ATTR_DSIZE(2);
DMA_TCD0_NBYTES_MLNO = 0x04;
DMA_TCD0_DOFF = 0x04;
DMA_TCD0_CITER_ELINKNO = DMA_CITER_ELINKNO_CITER(1);
DMA_TCD0_BITER_ELINKNO = DMA_BITER_ELINKNO_BITER(1);
I would expect that 4 bytes would be copied, but instead 20 bytes are copied.
If I then change the minor byte count register like this:
DMA_TCD0_NBYTES_MLNO = 0x08;
I would expect that 8 bytes would be copied, not 64 bytes, that actually is copied.
I must have misunderstod something, can someone explain the behaviour I see?
Regards,
Sebastian