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.

MSP430F67751A: How do I know when DMA is starting to receive data?

Part Number: MSP430F67751A

Hello, I am doing a UART application using DMA. A fixed size data is received every 10 seconds via UART. Baudrate: 115200.

I use repeated single transfer, How i know when DMA start to receive data?

  • DMAnSZ is (visibly) decremented at each transfer, so as a polling mechanism you can see if DMAnSZ has changed from what you originally set. You could get an asynchronous indication (DMAIFG) by setting DMAnSZ=1, but that would seem to defeat the purpose of the DMA.

    With repeated-single there's a race after DMAnSZ hits 0 (and gets re-set), but for that case you'll get a DMAIFG instead.

    [Ref User Guide (SLAU208Q) Sec 11.2.2.1 and Fig 11-3]

  • Hello Bruce,

    Thanks for your answer, but these methods don't work for me because the buffer size I use for DMA is 500 bytes, but the size of the packets I receive (every 10 seconds) is 60 bytes. I want to know when this 60 bytes data come.

  • OK, that's a slightly different question. It sounds as though you want (a) an asynchronous notification (IFG) when (b) the DMA has progressed by a particular amount (60 in this case).

    In (some) other DMA designs, this is accomplished by what's usually referred to as a "half-transfer" interrupt, which gives you time to unload the first half of the buffer while the second half is being filled. I've also wanted this feature, but as far as I know none of the MSP430 DMA units can do this.

    I think the closest you can get is to set your buffer size to 60 and unload the (entire) buffer quickquick before the next byte appears. In general, you only get one byte time to do this, but in your case it sounds like you have close to 10 seconds, which isn't a very tight time budget.

**Attention** This is a public forum