4
\$\begingroup\$

I have an Xmega Xplained 128A1 kit along with an AVR Dragon.

Can anyone help me with the steps to be followed for programming Xmega using Dragon using Atmel Studio 6?

I have downloaded the material from the Atmel website and have the necessary codes and other stuff. Unfortunately, the manual shows the steps with Studio 5.

The steps which I took:

  1. Created the project in Atmel Studio.
  2. Added the include files to the project folder.
  3. Built the project. Build was successful.
  4. Then compiled it. Compilation was also successful.

Now what to do next. I tried debugging, but it was taking too long and thus cancelled it.

\$\endgroup\$
  • \$\begingroup\$ I used Atmel studio 6 last year so don't exactly remember where things are but did you select the micro from the list of micros in project settings? \$\endgroup\$ – David Norman Jun 19 '13 at 8:27
  • \$\begingroup\$ Where can I find it? Currently, Project Menu has Show all files, Set as Start up project, Project Properties. \$\endgroup\$ – Enthusiast Jun 19 '13 at 8:29
  • 1
    \$\begingroup\$ I don't I figured out everything myself with no help of the internet. Under Project properties you should have selected the microcontroller. Can you read the signature from the micro? \$\endgroup\$ – David Norman Jun 19 '13 at 8:34
  • 1
    \$\begingroup\$ yeah go for it update it \$\endgroup\$ – David Norman Jun 19 '13 at 8:42
  • 2
    \$\begingroup\$ Someone should post what worked as an answer so we can 1) upvote it and 2) the question won't appear unanswered. \$\endgroup\$ – JYelton Jun 19 '13 at 14:57
7
\$\begingroup\$

I recently installed Atmel Studio 6 and upgraded a project that had to be manualy recreated so I thought I'd document the process including use of an AVR Dragon. The first step was to create a new project and as my code was C++ I selected GCC C++ Executable Project:

Project creation

The next step is device selection, a search facility is provided that saves sifting through the entire list of devices:

Device selection

The next step required for most projects is to define the CPU frequency. I went into Project | Properties and went to the symbols tab for the compiler I'm using, in this case C++. There I defined F_CPU by pressing the add button and typing F_CPU=11059200 to suit the crysyal I'm using. Once done the screen looks as follows (note that I corrected the value after taking the screenshot, it was missing a zero):

Setting the F_CPU clock speed

In the same area you can go down to the tool tab and define the type of debugger / programmer and the interface. In my case I was using the JTAG interface, different options will appear if using ISP but the defaults are normally OK.

Selecting the debugger / programmer

Once that's been saved you can click on the device programming icon on the toolbar or press Ctrl + Shift + P to get to the device programming screen.

Device programming toolbar

Once you've confirmed the correct tool, device and interface is selected you can press the apply button to connect. It's likely the AVR Dragon will require a firmware update to work so press the upgrade button if prompted to do so and wait for the upgrade to complete.

Device programming screen

Once connected you'll be able to read the device signature and target voltage to confirm the connection to the target is OK. You can also program the various memories, lockbits and lock bits from the same screen.

Device programming

However once your configuration bits are have been set you may find it more convenient to use the start without debugging button on the toolbar to launch the project. That will automatically build the project if required, program the device and start the program.

Start without debugging

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ The pictures made the entire procedure extremely clear. Thanks. \$\endgroup\$ – Enthusiast Jul 20 '13 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.