ATXmega E-series EDMA - settings.

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Colleagues,
Is there anybody who used ATXmega E-series EDMA? I'd like to ask some questions regarding EDMA settings? Best regards... robiw

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you sure there aren't app notes for the new features like Events and DMA and so on?

 

Usually when Atmel introduce a new peripheral feature they produce notes to show how it could be used.

 

Another approach is to see if there's anything in "Start". It may be able to show you some DMA using example code.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Clawson.

In fact I read some datasheets regarding EDMA but they are not so clear like those for simple Mega/Tiny. I have some doubts regarding EDMA settings. I'd like to have automatic ADC transfer from ADC.CH0 register to array in memory. robiw

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I didn't find any notes or examples for EDMA, only for DMA but there are some important differences. robiw

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Nov 19, 2019 - 03:05 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

He he, I read them all. Whilst event system is nearly the same like in others but the EDMA i much more diffrent. No apps from Atmel...robiw

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It would be helpful if you had said what you'd read - then you wouldn't just get repeats of stuff you'd already seen!

 

Have you seen the ones I added in the EDIT ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I read them all except " https://www.avrfreaks.net/forum/xmega-e-series-edma-and-dac". It might be helpful. In fact I have some doubts if should I use peripheral or standard mode for EDMA and where are source/dest addresses among all registers. r

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the EDMA similar to any of the SAM chips ... ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, I don't know if it is...r

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

...after a while... I found it very usefull viewing Atmel Start...r

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'd like to have the EDMA transfer from ADC CH0 to memory which is triggered by every ADC conversion complete. I have prepared settings as follows. Could you check them?

 

		//Enable and configure DMA
		EDMA.CTRL =
					EDMA_ENABLE_bm|  //EDMA Enabled
					EDMA_CHMODE_STD02_gc|  //Channels 0 and 2 in standard configuration
					EDMA_DBUFMODE_DISABLE_gc|  //No double buffer enabled
					EDMA_PRIMODE_RR0123_gc;  //Round robin on all channels

		EDMA.CH0.ADDR = (uint16_t) &ADCA.CH0RES;  //Channel Source Address for Standard Channels

		EDMA.CH0.ADDRCTRL =  //Source Address Control for Standard Ch.
					EDMA_CH_RELOAD_BURST_gc|  //Reload at end of each burst transfer
					EDMA_CH_DIR_INC_gc;  //Increment

		EDMA.CH0.DESTADDR = (uint16_t) Buffer; //Channel Destination Address for Standard Channels

		EDMA.CH0.DESTADDRCTRL =  //Destination Address Control for Standard Channels Only
					EDMA_CH_DESTRELOAD_TRANSACTION_gc| //Reload at end of each transaction
					EDMA_CH_DESTDIR_INC_gc;  //Increment

		EDMA.CH0.TRFCNT = sizeof(Buffer);  //Channel Block Transfer Count for Standard Ch.
		EDMA.CH0.TRIGSRC = EDMA_CH_TRIGSRC_ADCA_CH0_gc;  //ADCA CH0 as trigger

		EDMA.CH0.CTRLA =
					EDMA_CH_SINGLE_bm|  //Channel Single Shot Data Transfer
					EDMA_CH_BURSTLEN_bm;  //Channel 2-bytes Burst Length

		EDMA.CH0.CTRLA |= EDMA_CH_ENABLE_bm;  //Channel Enabled;

		EDMA.CH0.CTRLB = EDMA_CH_TRNIF_bm|EDMA_CH_TRNINTLVL_HI_gc;  //High level Interrupt

robiw