Other Parts Discussed in Thread: MSP430F5438A
Hi,
I am using MSP-EXP430F5438 experiment board with MSP430F5438A. I want to transfer data from ADC12MEM0 to a buffer. I looked into the sample project of User Experience and don't understand how the transfer size came. Here is the code which is in audio.c:
__data16_write_addr((unsigned long)&DMA0DA & 0xffff, (unsigned long)AUDIO_MEM_START[i]);
DMA0SZ = AUDIO_MEM_START[i + 1] - AUDIO_MEM_START[i] - 1;
record();
if (DMA0SZ != AUDIO_MEM_START[i + 1] - AUDIO_MEM_START[i] - 1)
{
lastAudioByte = AUDIO_MEM_START[i + 1] - DMA0SZ;
break;
}
else lastAudioByte = AUDIO_MEM_START[i + 1] - 1;
Here I notice that the transfer size is calculated by "AUDIO_MEM_START[i + 1] - AUDIO_MEM_START[i] - 1". Why there is a "-1". If I only want to transfer one unsigned long, then what should the size is?
Thanks.
Shan