Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
craignied
PostPosted: May 27, 2012 - 01:18 AM
Newbie


Joined: Apr 27, 2012
Posts: 19


I have this strange behavior programming an ATxmega32A4U with a JTAGICE3 and Atmel Studio 6. I have the xmega now in a prototype PC board and I am trying to program it through the PDI interface. It programs once, no problem, but after that, the Device ID is not recognized: I get a box in Atmel Studio that says "unable to enter programming mode." It's reading a target voltage of 3V fine, and I've tried various voltage sources. I've verified this behavior with two boards.

I've attached the salient part of the PC board schematic, and it's about as straightforward as it can be from the data sheet. I must be missing something obvious. Does anyone have any ideas?

Many thanks in advance!
 
 View user's profile Send private message  
Reply with quote Back to top
DocJC
PostPosted: May 27, 2012 - 02:09 AM
Raving lunatic


Joined: Dec 11, 2007
Posts: 6843
Location: Cleveland, OH

Your schematic doesn't show a common ground between the Xmega and the programmer. I assume there is one.

JC
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
craignied
PostPosted: May 27, 2012 - 03:12 AM
Newbie


Joined: Apr 27, 2012
Posts: 19


Yes, sorry. Grounded is pins 8, 18, 30, and 38 of the ATxmega32A4U and pin 3 of a 4 wire PDI socket. It programs fine for the first time, so something's working. I just can't figure out why it can't be programmed after the first time. I must be missing something obvious, but can't figure it out.
 
 View user's profile Send private message  
Reply with quote Back to top
DocJC
PostPosted: May 27, 2012 - 12:16 PM
Raving lunatic


Joined: Dec 11, 2007
Posts: 6843
Location: Cleveland, OH

I don't have a JTAGICE3, so I am not familar with its use.

The concern is that AVR6 is still rather new, so the question is this: Is it a hardware issue, a programmer issue, or an AVR6 issue?

If AVR Studio has the option to upgrade the software on the programmer then you should that.

If you re-boot the computer, and cycle power on both the programmer and the Xmega PCB will it then work again?

You did not show any caps or resistors on the PDI programming lines. I assume that there are none there. (The loading on each line needs to be the same, and none are required.)

Do you have another test platform with which you can test your hardware?

Do you have another testbed, and does it work properly on the JTAGICE3?

JC
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
craignied
PostPosted: May 27, 2012 - 01:23 PM
Newbie


Joined: Apr 27, 2012
Posts: 19


Thanks, JC. The weirdness is that it programs once, just fine, then won't program again. Same behavior with two boards. To your questions:

The firmware on the JTAGICE3 is the latest version, verified this morning. Rebooting the computer and recycling the programmer and Xmega PCB results in the same problem. No resistors on the PDI programming line, and I experimented with a 1000 pF cap between Vcc and clock as described at http://www.atmel.no/webdoc/jtagice3/jta ... ssues.html without success. (I then removed the cap.) The JTAGICE3 works just fine with an STK600 as both a programmer and debugger, and it worked as a programmer just fine with my boards, only just once.

What's really confusing is why it recognizes the Xmega device ID and programs it just once, then can't recognize the device ID after that.
 
 View user's profile Send private message  
Reply with quote Back to top
DocJC
PostPosted: May 27, 2012 - 01:41 PM
Raving lunatic


Joined: Dec 11, 2007
Posts: 6843
Location: Cleveland, OH

Quote:
with an STK600


I'm glad you have a 600.

Is the Xmega re-programmable using the STK600. (You can use a 6-Pin ribbon cable from the STK600's PDI Header to program off-board PCB's).

If the Xmegas can be programmed multiple times with the STK600 then the Xmega and its board are eliminated as the problem, and it points to AVR Studio 6 and the ICE3.

JC
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
craignied
PostPosted: May 27, 2012 - 04:47 PM
Newbie


Joined: Apr 27, 2012
Posts: 19


Thanks: you're officially awarded the "you are a Genius, I am an idiot" designation for the day, which is unfortunately often given. Both Xmegas on my prototype PC boards can be programmed more than once with the PDI on the STK600. I'd love to install Atmel Studio 5 to see if that allows programming via the JTAGICE3, but the "Atmel AVR Studio 5" download link at http://www.atmel.com/microsite/avr_stud ... fault.aspx points to http://www.atmel.com/tools/ATMELSTUDIO.aspx, which as far as I can tell, only allows downloading Studio 6.
 
 View user's profile Send private message  
Reply with quote Back to top
DocJC
PostPosted: May 27, 2012 - 04:52 PM
Raving lunatic


Joined: Dec 11, 2007
Posts: 6843
Location: Cleveland, OH

I'm glad it is working.

At least you have a work-around solution for now.

JC
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
larryvc
PostPosted: May 27, 2012 - 10:20 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

craignied wrote:
Thanks: you're officially awarded the "you are a Genius, I am an idiot" designation for the day...

Does that mean that Doc has to go around saying "you are a Genius, I am an idiot" today.

Good luck with that Doc. Wink

craignied, nice to see you got your stuff working with Doc's help. I wouldn't bother trying to download AS5 as it is just a very buggy earlier version of AS.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
craignied
PostPosted: May 27, 2012 - 11:17 PM
Newbie


Joined: Apr 27, 2012
Posts: 19


Sadly, I am the sole designator of that award and consequently, the idiot always refers to me... I did find and install AVR Studio 5 before I read your post, Larry, and discovered what you implied. It didn't solve the problem.

I'd still love to get a "smaller" PDI programmer working like the JTAGICE3. I'll be testing these devices in the field, and the STK600 footprint is less luggage friendly.
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: May 27, 2012 - 11:58 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

You can get a programmer based on LUFA

http://www.fourwalledcubicle.com/AVRISP.php

at

http://tom-itx.dyndns.org:81/~webpage/b ... _index.php

I have a similar device and it works great. There are two different .hex files for the programmer. One for using it with avrdude and one for Studio. The best of both worlds with a minor inconvenience.

All the best.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
DocJC
PostPosted: May 28, 2012 - 01:37 AM
Raving lunatic


Joined: Dec 11, 2007
Posts: 6843
Location: Cleveland, OH

Off course for a few dollars more you can get an Atmel AVRISP mkII, which will work with AVR Studio 4/5/6, and works great. It comes with a fully enclosed plastic case and a USB cable. Highly recommended.

The USBTiny mentioned above is a better deal now than it used to be, as they have cut the price and given it a plastic case. Of course in the description it states it works with AVR Studio 4, which won't do Craig any good, as he is using one of the newer Xmegas with USB, which isn't supported by AVR Studio 4. Perhaps Dean has upgraded LUFA to support the AVR Studio 6.

But with the Amtel AVRISP mkII one doesn't have to wonder about it, or "build" their own LUFA version for the programmer. And given Craig's recent luck with the ICE3 I'm not sure it is worth saving a few dollars vs getting a known good programmer.

Genius of the day, Wink

JC
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
squidgit
PostPosted: May 28, 2012 - 02:47 AM
Raving lunatic


Joined: Sep 14, 2003
Posts: 4228
Location: Queanbeyan, Australia

craignied wrote:
Both Xmegas on my prototype PC boards can be programmed more than once with the PDI on the STK600.
FWIW I regularly have to disconnect the JTAGICE3 USB Cable, close AVR Studio 6, occasionally force-kill avrdbg.exe then open AVR Studio 6, re-connect the JTAGICE3 and pray to $DEITY it all comes back online. Some kind of Studio/avrdbg/JTAGICE state machine something gets confused, have to close every bit of the chain and bring them back from scratch.

And no, doing just one of the above steps doesn't fix the problem, you have to go through the whole dance! Hey, I used to think I had to reboot my PC each time, at least I've worked out that isn't the case!

-S.

_________________
Blag: http://www.niasdigital.com/blag
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: May 28, 2012 - 03:52 AM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

DocJC wrote:
Of course in the description it states it works with AVR Studio 4, which won't do Craig any good, as he is using one of the newer Xmegas with USB, which isn't supported by AVR Studio 4. Perhaps Dean has upgraded LUFA to support the AVR Studio 6.


I'm using my clone with AS6 and it is programmed with the latest LUFA AVRISP mkii Clone project software. I have had no problems with it at all.

From the USBtiny web site:
Quote:
LUFA 12-03-18 AVISP-MKII Firmware update available.

Files as of 03/18/2012:

Changes include:
Updated the AVRISP-MkII Clone programmer project to be compatible with the latest version of AVR Studio (version 5.1)
Changed the AVRISP-MKII Clone programmer project to report a fixed 3.3V VTARGET voltage on USB AVRs lacking an ADC instead of 5V to prevent warnings in AVR Studio 5.1 when programming XMEGA devices
Fixed error in the AVRISP-MKII programmer when ISP mode is used at 64KHz

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
craignied
PostPosted: May 28, 2012 - 06:05 PM
Newbie


Joined: Apr 27, 2012
Posts: 19


Thanks, Squidgit, for confirming that I'm not alone in my JTAGICE3 troubles. Doc, you attain the "You are a Genius, I am an idiot" award for a second straight day, which is no small achievement, although the "I am an idiot" part is terribly common. I had assumed that the AVRISP MKII is a dumb cousin to the JTAGICE3, and my assumptions turn out to be nearly always wrong. I dug up one that I had procured a while ago, hooked it up, and it happily reprograms my Xmega PC board. What's really cool is that its socket is the same as the typical PDI pinout when it's in PDI mode in Atmel Studio. That made hooking it up very easy.
 
 View user's profile Send private message  
Reply with quote Back to top
craignied
PostPosted: Jun 02, 2012 - 05:39 PM
Newbie


Joined: Apr 27, 2012
Posts: 19


OP here, if anyone comes across this thread. I found the JTAGICE3 solution. I put a 100K resistor between data and ground on the PDI. Works a charm. I found it at http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=108311&postdays=0&postorder=asc&start=0.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits