Beginner Questions about XMegaA3BU

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

Hi all,

 

I'm using an Atxmega256A3BU for the first time and I have a few questions.

 

- is it correct to program it from AS7 by holding down SW0, and then plugging in the USB? (I included a screenshot of the datasheet)

- what are some advantages of using an external debugger instead of Atmel Flip?

- does my source code look okay to turn on the User LED? As of now it's not working yet

 

#include <asf.h>
#include <stdio.h>

int main(void)
{
PORTR_DIRSET=PIN0_bm;
PORTR_OUTSET=PIN0_bm;
	while (1) {
	}
}

 

Thanks

Attachment(s): 

This topic has a solution.
Last Edited: Wed. Aug 2, 2017 - 05:55 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

daisy148 wrote:
what are some advantages of using an external debugger instead of Atmel Flip?
It lets you DEBUG? (Flip only allows for programming)

 

And code looks OK always assuming the LED is on bit 0 or PORT R. However that just sets the bit - are you sure the LED is "active high" or might it actually be "active low"?

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

Looking at the schematic for the XMEGA256A3BU Xplained, the two User LEDs are on PORTR.0 and PORTR.1, but they are active low.

Greg Muth

Portland, OR, US

Atmel Studio 7.0 on Windows 10

Xplained/Pro/Mini Boards mostly

 

 

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

They are active low - I got them both to flash, thanks!

 

Sidenote.. unless I'm doing it wrong, I'm noticing that FLIP is really hard to use.

After hitting "start application", it disappears from my device manager tree, so I've been re-plugging the USB and holding down SW0 to reload programs. Has anyone come experienced this? Perhaps it would be better to buy an Atmel ICE

Last Edited: Tue. Aug 1, 2017 - 05:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

daisy148 wrote:
Sidenote.. unless I'm doing it wrong, I'm noticing that FLIP is reaallly hard to use.
Some FLIP alternatives :

  • dfu-programmer
  • AVRDUDE 6.3

daisy148 wrote:
Is it better to just buy an Atmel ICE?
Yes for speed, no for loader

IIRC, an XMEGA datasheet has a PDI speed figure that's impressive; Atmel-ICE communicates with the XMEGA Program/Debug Controller state machine.

A USB DFU loader communicates with a USB DFU bootloader; that should be slower than an Atmel-ICE though there are fewer parts.

 


http://dfu-programmer.github.io/

AVR Downloader/UploaDEr - News: AVRDUDE 6.3 released

http://savannah.nongnu.org/forum/forum.php?forum_id=8461

...

 

* New programmers supported:

...

- Atmel DFU, using FLIP protocol version 1 (AT90USB and ATmegaU devices),
or version 2 (Xmega devices)

...

via http://savannah.nongnu.org/projects/avrdude

 

"Dare to be naïve." - Buckminster Fuller

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

Thanks for the reply.

 

I got it to work in AS7 with this great thread: http://www.avrfreaks.net/forum/a....

 

..I went with the usual Tools>External Tools>Add, and then entered these arguments.

 

Command:

C:\Program Files (x86)\Atmel\Flip 3.4.7\bin\batchisp.exe

Arguments:

-device atxmega256a3bu -hardware usb -operation erase f memory flash blankcheck loadbuffer "$(TargetPath)" program verify start reset 0

Initial Directory:

$(TargetDir)

So, one goal accomplished. That is to program it within AS7, but, the board still disconnects each time I program it (with the Windows' USB ding-dong sound happening after uploading). Gchapman, you mentioned dfu-programming and avrdude as alternatives. Would these fix this issue? To be honest, it's mostly for convenience just so I don't have to re-plug it in each time, because I'll be using this board a lot these next couple months. Or is using Atmel ICE a better bet?

 

Edit: I bit the bullet and bought an Atmel ICE, so this is somewhat obsolete now. Thank you for your help though, and to those who helped me blink the LED!

Last Edited: Tue. Aug 1, 2017 - 07:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't remember having problems using avrdude flip2 to program this board.   I just tried today running Win10 1703 and found Atmel's driver doesn't work.  I tried to reinstall the driver and got an error in the .inf file.  Actually I didn't really know what I was doing.  I just pointed Microsoft's driver installer at Atmel's USB_DRIVER folder and turned it loose.  I have AS 6.2 installed.  That might be the problem with the driver.

 

It's not a pressing problem though because I seldom use the board.  I should be able to program it with my AVR ICE and PDI.  And I can also boot up another Windows installation.  And I could install a non-DFU bootloader like my quick and dirty AVR911 bootloader.  I just keep this board with Atmel's DFU bootloader around for intellectual curiosity.

 

 

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

As is usually the case, this Atmel board doesn't come with a reset button.  I fixed that.  I have a little board that plugs into the JTAG port.  It gives me a reset button and a Steve17 standard PDI connector.  I also have a small plugin board that gives me a Steve17 standard USART connector.