Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216808

Forum Post: DMA on F28069

$
0
0

Hello,

I'm working to use DMA to transfer data from the ADC result register to a buffer. I followed the example code, but I'm missing a step somewhere that is making it not work. I know other people have posted about similar issues with similar code, but I haven't been able to find any solutions.  

Here is what I'm doing:

- Initialize EPWM3 to trigger SOC1

- Initialize ADC; EOC1 is enabled trigger an interrupt flag for ADCINT1 (but the actual interrupt is not set up)

- DMA is set to use ADCINT1 as a peripheral interrupt source and has a source of AdcResult1 (that does not increment) and a destination of AdcBuf (that does increment).

- DMA Interrupt is enabled to trigger at the end of the transfer

The code enters the DMA interrupt after the correct number of cycles (I know this because the PWM period is 80 cycles and the Buffer is 100. So if I measure the clock cycles from the start of the PWM clock to the DMA interrupt, I get 8200 or so, which seems correct).  The only problem is that when I check the ADCBuf register (the supposed destination), nothing has been written to it. 

I've attached my code if anybody wouldn't mind taking a look to see if I'm missing something. The DMA clock is turned on in the Device Initialization. 

(Please visit the site to view this file)

I also noticed an inconsistency between the technical reference manual and the examples. In the TRM, Bits 12 and 13 of the DMA Mode register are reserved, but in the example code, bits 12 and 13 are bits called SyncE and SyncSel. This makes it difficult to understand what to put in these registers.


Viewing all articles
Browse latest Browse all 216808

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>