Posted: Tue Apr 21, 2015 9:46 pm Post subject: Xmega DMA_ready, which channel?
Hello,
To do faster ADC data grabbing I now looked for the Xmega and tried Mak3's samples.
I want to grab ADC samples repeatedly, triggered by an ADC value (like Osci trigger).
It does not work yet (but hopefully at some short time), so I have to dig into the details.
One of the questions:
The Xm256a3bu (like others) has several DMA channels. The register list as displayed in the IDE just shows one DMA_ready (which is used by Mak3).
However, according to the manual, there is a flag for each DMA channel:
"INTFLAGS – Interrupt Status register:
Bit 3:0 – CHnTRNFIF[3:0]: Channel n Transaction Complete Interrupt Flag"
How is DMA_ready related to the DMA channels?
Best regards, Meister
not sure what examples you mean but DMA_ready is only user flag used also in BASCOM examples (in manual)
If you need handle DMA events you need set up DMA interrupts and then check what situation trigger the interrupt, for example:
Code:
On Dma_ch0 Dma_ch0_int
Dim Dma_ready asbit Dim Dma_channel_0_error asbit
Do
Bitwait Dma_ready , Set' Wait until first DMA transaction is ready (DMA TRANSACTION COMPLETE Interrupt) Reset Dma_ready
Loop
Dma_ch0_int:
'DMA0 COMPLETE flag Dma_intflags.0 If Dma_intflags.0 =1Then Set Dma_intflags.0
Set Dma_ready
End If
'DMA0 ERROR flag Dma_intflags.4 If Dma_intflags.4 =1Then Set Dma_intflags.4
Set Dma_channel_0_error ' End If
Hi Tomi,
thank you. I had not seen that DMA_ready is a user variable. When I looked into the Code Explorer, DMA_ready is listed, but "Find References" does not show the Dim statement. I think in previous Bascom versions the Dim line was also listed there (now it is accessed by clicking on the top line).
Regards, Meister
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum