This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

msp430f2618 DMA address assignment

Other Parts Discussed in Thread: MSP430F2618

I am using MSP430F2618 Microcontroller and doing programming in Code composer studio v6. 

I have seen below two instructions for DMA operation but i don't know meaning of those...

Please explain below two instructions...

DMA0SA = (void(*)())sample; // Source block address
DMA0DA = (void(*)())&DAC12_0DAT;

here sample is the name of array which i defined to store the data of integer type. 

  • The SA/DA registers have 20 bits to be able to access the entire address space.

    "(void(*)())" casts the value to a function pointer. This ensures that the DMA registers are written with 20-bit values even if the compiler is configured to use 16-bit data pointers.
    (A better way would be to use the __data16_write_addr() function.)
  • Hi,

    i use following array to store the data

    sample [] ={1,2,3....}

    now as per array property 'sample' variable contains the address of first element of array.

    so can i write DMA0SA = sample; ?

    what is __data16_write_addr() function ? please explain it in detail
  • When your array is in the lower 64 KB address space, or when data pointers use 20 bits, you can assign the address directly.

    See the application report SLAA376: Extended Memory Access Using IAR and CCE for details.

**Attention** This is a public forum