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.

msp430fg439 memory access DAM0SA

Other Parts Discussed in Thread: MSP430FG439

Hello...

I'm working with msp430fg439, I define segment memory (DMA0SZ = finalmem1-iniciomem1) and I  can save just one byte to DMA0SA flash memory register.

I want to know how to define DMA1SA and DMA2SA, attached picture shows the way used to save data. But the code contained in the circle shows an error on IAR.

How can I access to whole DMA one by one byte?

Thanks for your help.... and ask me again if you have a doubt about I'm saying

This is the picture with used code http://i923.photobucket.com/albums/ad80/dominatemetalmanizales/photo.png

  • DMACTL0 is a 16bit register that can only be written 16 bit, and contains DMA0TSEL and DMA1TSEL.

    So for DMA channel 0 and 1, you'll have to write the trigger select together in one instruction.

    In your code, you write DMA0TSEL_6 to DMACTL1, which sets the trigger for channel2. You'll have to use DMA1TSEL_6 and write it together with DMA0TSEL_6 to DMACTL0. At the same time, or the second write will nullify the first.

    That's actually the same problem that initially brought me here to this forum two years ago. But at this time, the users guide did list the upper and lower half of DMACTL0 as two independently writable registers DMACTL0_L and DMACTL0_H.

    The current users guide correctly list them as word registers. And what to write there.

  • I checked your answer... however.... I obtained the error showed on this attached picture, which was an obtained error before.....

    http://i923.photobucket.com/albums/ad80/dominatemetalmanizales/fotos.png

    Thanks for your help....

  • The FG43x datasheet doesn't explicitely name it in the overview, but if you take a look on the peripheral file map, you'll see only the DMA0 registers listed there, so it seems that this MSP has only one DMA channel. While most have 3 and the users guide talks about up to eight.
    It is, of course, possible that the datasheet is wrong, and the include file was built based on this map, so only the DMA0 registers have been defined while the others exist. I really don't know.
    You can try to define them by yourself. Check the inlcude files how the DMA0 registers have been defined and do the same for DMA1 (of course with different addresses). You might be able to copy from the include files for a different MSP. IF it is a datasheet error and the registers do exist, and if the MSP you take fo rcopying has the DMA0 registers at the same memory location, then chances are that copying the DMA1 definitions to your C file will work.
    Lots of if's, however.

  • Your answer was very usefull... thanks for your help. Really, the datasheet clearly says "Single-Channel Internal DMA" that's what your doing.

    I have another problem at a time. That seems I can't clarity about DMA0SA. I think DMA0SA avoid to record data in the flash memory. In my case I desire record a number of 50kb.

    when I try to do this, the IAR workbench compiler just allow me put a number of 2 bytes.

    Thanks for your help...

  • DMA0SA is the memory address of the place where the data comes from. It wouldn't make much sense if you had to copy the data first manually to DMA0SA before it then can be forwarded by DMA to its destination.

    DMA0SA is a 16 bit register on MSPs with 64k address range and a 20 bit register on MSPs with 20 bit address range. In the latter case, it can be written with a 16 bit value (the usualy case, as RAM and hardwar eregsiters all reside in first 64k). But to write a 20bit address to it, a 20 bit write instruction needs to be used. I'm not sure whether this is supported in C (maybe with large dat amodel, but I don't know for sure) , so maybe inline assembly is required.

**Attention** This is a public forum