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.

TMS320F280025C: right way using DMA to get ADC result

Part Number: TMS320F280025C
Other Parts Discussed in Thread: C2000WARE

Hi, Gurus:

Because C2000Ware seems not have peripherial to GS0RAM DMA example, I'm wondering is it possable/ safe to move data from peripherial's memory address to GS0RAM.

As datasheet shows, 280025C's DMA bus is connect to ADC results and GS0 RAM.

I guess I can modify the example "dma_ex2_gsram_transfer", change the "*srcAddr" to ADC result address (like ADCARESULT0 0x0B00), and I'm ready to go?

If yes, Is this means when DMA trigger source trigger the DMA event, the data from ADCRESULT0 will move to destination address in TRM pp.1153 shows?

If not, how to get the result using DMA?

If I use PWM1.SOCA to both trigger ADCSOC0 and DMA teansfer, can DMA get the right result? Or I'll get previous result of ADC convertion?

Here are two different way to get ADC result:

1.Use PWM1.SOCA to trigger ADCSOC0, and after convertion, ADCEOC0 will happened and fire ADCINT1, and I set DMA trigger by ADCA.1 then I got ADC result.

2. Use PWM1.SOCA to trigger ADCSOC0, and after convertion, ADCEOC0 will happened and fire ADCINT1, but I didn't use DMA but get ADCRESULT0 by using CPU.

Which one has lower latency? How much time can it save?

Thanks!

  • Hello,

    I'm wondering is it possable/ safe to move data from peripherial's memory address to GS0RAM.

    It should be possible to read from the ADC result registers and copy this data to GS0RAM (it will not be erasing what it copies, the DMA only transfers the data):

    I guess I can modify the example "dma_ex2_gsram_transfer", change the "*srcAddr" to ADC result address (like ADCARESULT0 0x0B00), and I'm ready to go?

    If yes, Is this means when DMA trigger source trigger the DMA event, the data from ADCRESULT0 will move to destination address in TRM pp.1153 shows?

    That should be correct, as long as your trigger is set up and you have the proper addresses and burst/transfer size it should be sufficient.

    If I use PWM1.SOCA to both trigger ADCSOC0 and DMA teansfer, can DMA get the right result? Or I'll get previous result of ADC convertion?

    I would say it's more likely you'll get the previous result, since the ADCSOCA event starts the conversion, it doesn't actually indicate that the result is ready.

    1.Use PWM1.SOCA to trigger ADCSOC0, and after cponvertion, ADCEOC0 will happened and fire ADCINT1, and I set DMA trigger by ADCA.1 then I got ADC result.

    2. Use PWM1.SOCA to trigger ADCSOC0, and after cponvertion, ADCEOC0 will happened and fire ADCINT1, but I didn't use DMA but get ADCRESULT0 by using CPU.

    Which one has lower latency? How much time can it save?

    Sorry, I'm not sure I quite understand the two configurations you listed. Does the first one have the DMA triggered by the ADC interrupt or the ADCSOCA event? And is the second one using the DMA software trigger instead? I would say using the ADC interrupt would have less latency and you should be able to expect the current result to be transferred.

  • Hi, Omer

    Thanks for the reply.

    Sorry, I'm not sure I quite understand the two configurations you listed. Does the first one have the DMA triggered by the ADC interrupt or the ADCSOCA event? And is the second one using the DMA software trigger instead? I would say using the ADC interrupt would have less latency and you should be able to expect the current result to be transferred.

    The first is using DMA which triggered by ADC interrupt source.

    And the second is use CPU to get the ADC result in ADC interrupt, like "Vin = AdcaResultRegs.ADCRESULT1;" I think this is slower then DMA access, am I right?

    Thanks!

  • And the second is use CPU to get the ADC result in ADC interrupt, like "Vin = AdcaResultRegs.ADCRESULT1;" I think this is slower then DMA access, am I right?

    Yes, using the CPU will almost always be slower because the CPU may have other interrupts or code running before it can eventually move the data.