Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

JTAG interface works even without MCU clock

JTAG interface works even without MCU clock

2004-08-10 by Graham Davies

Here is something I've learned by experience and verified with Atmel 
support. If you have an AVR MCU that has JTAG support, you can get 
into the device even if there is no MCU clock. You can't run and 
debug a program, but you can get in to repair mis-set clock selection 
fuses. Is that neat, or what?

Here's what happened. I was bringing up a new board with an 
ATmega169. I am convinced that programming without in-circuit debug 
is like tight-rope walking without a net, so I insist on bringing out 
the JTAG interface.  But, I can't use it until I get the JTAG enable 
fuse programmed, so I have to use in-system programming as well. So, 
I'm connected up to an STK500, I've read the fuses out, checked the 
JTAG enable fuse checkbox and hit write. This is when the weight of 
cables hanging off the desk pulls my very light board down and breaks 
the power connection. When I put it all together again, the in-system 
programming link is dead. I figured I was hosed, but in desperation I 
hooked up my JTAG-ICE clone and, lo and behold, it worked. The JTAG 
fuse got programmed, but the clock setting fuses got messed up too 
and the MCU was waiting for an external clock. I fixed this and 
everything is fine again. Atmel support confirms that the JTAG 
interface does *not* need an MCU clock for programming and uses its 
own. ISP, however, requires a correctly configured clock source.

In case anyone is interested, the JTAG-ICE clone is of my own rather 
unique design and you can see what it looks like here:
http://www.ecrostech.com/Other/BflyCarrier.jpg
I have been thinking about making both it and the Butterfly Carrier 
board shown in the picture into products but I can't get a reading on 
how well they might sell.  I would slightly undercut the other clones 
for the JTAG-ICE at, say, $39.95 and the Butterfly Carrier bare board 
would be $9.95.

Graham.

Re: JTAG interface works even without MCU clock

2004-08-10 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "Mike Murphree" <mike@t...> wrote:

> As a FPGA designer, this is not
> surprising...  One of the JTAG
> signals *is* a clock ...

That's true, but one of the signals of the other in-system 
programming interface (MOSI/MISO/SCK) is a clock too, so I don't 
think it's quite that simple.

> Looks good to me...  I could
> use both of these about now.

If you're serious, Mike, perhaps you'd like to contact me offline. I 
have boards for two more prototypes (as in the photo with no solder 
mask or silkscreen). If you'd be OK with a prototype JTAG-ICE (which 
has no errata) I'd throw in the Butterfly Carrier for free (which has 
two minor errata).

> Besides AVR Studio is there any other software (i.e. GDB) that
> supports JTAG debugging now on the AVR?

Yes. I quote from the WinAVR readme file: "AVaRICE is a program for 
interfacing the Atmel JTAG ICE to GDB and users can debug their AVR. 
Use in conjunction with GDB." This probably works on Linux and Mac 
platforms too. Mind you, I haven't tried it, as AVR Studio seems 
pretty good to me. Building with WinAVR and debugging on AVR Studio 
is much more "seamless" than you'd think.

Graham.

Re: [AVR-Chat] JTAG interface works even without MCU clock

2004-08-10 by Mike Murphree

Graham Davies said:
> Here is something I've learned by experience and verified with Atmel
> support. If you have an AVR MCU that has JTAG support, you can get  into
> the device even if there is no MCU clock. You can't run and
> debug a program, but you can get in to repair mis-set clock selection
> fuses. Is that neat, or what?
>
> Here's what happened. I was bringing up a new board with an
> ATmega169. I am convinced that programming without in-circuit debug  is
> like tight-rope walking without a net, so I insist on bringing out  the
> JTAG interface.  But, I can't use it until I get the JTAG enable  fuse
> programmed, so I have to use in-system programming as well. So,  I'm
> connected up to an STK500, I've read the fuses out, checked the  JTAG
> enable fuse checkbox and hit write. This is when the weight of  cables
> hanging off the desk pulls my very light board down and breaks  the
> power connection. When I put it all together again, the in-system
> programming link is dead. I figured I was hosed, but in desperation I
> hooked up my JTAG-ICE clone and, lo and behold, it worked. The JTAG
> fuse got programmed, but the clock setting fuses got messed up too  and
> the MCU was waiting for an external clock. I fixed this and
> everything is fine again. Atmel support confirms that the JTAG
> interface does *not* need an MCU clock for programming and uses its
> own. ISP, however, requires a correctly configured clock source.

As a FPGA designer, this is not surprising...  One of the JTAG signals
*is* a clock and the only other thing you usually need is power.

> In case anyone is interested, the JTAG-ICE clone is of my own rather
> unique design and you can see what it looks like here:
> http://www.ecrostech.com/Other/BflyCarrier.jpg
> I have been thinking about making both it and the Butterfly Carrier
> board shown in the picture into products but I can't get a reading on
> how well they might sell.  I would slightly undercut the other clones
> for the JTAG-ICE at, say, $39.95 and the Butterfly Carrier bare board
> would be $9.95.

Looks good to me...   I could use both of these about now.

Besides AVR Studio is there any other software (i.e. GDB) that
supports JTAG debugging now on the AVR?

Mike

Re: [AVR-Chat] Re: JTAG interface works even without MCU clock

2004-08-13 by Brian Dean

On Tue, Aug 10, 2004 at 06:46:38PM -0000, Graham Davies wrote:

> Yes. I quote from the WinAVR readme file: "AVaRICE is a program for
> interfacing the Atmel JTAG ICE to GDB and users can debug their AVR.
> Use in conjunction with GDB." This probably works on Linux and Mac
> platforms too. Mind you, I haven't tried it, as AVR Studio seems
> pretty good to me. Building with WinAVR and debugging on AVR Studio
> is much more "seamless" than you'd think.

But if you are using a Mac, Linux, or FreeBSD, AVR Studio is not
really an option since it is Windows-only.

That's where AVaRICE comes in - it works well on Mac, Linux, and
FreeBSD.  I personally use it on MacOS X and FreeBSD.  Logically,
AVaRICE is positioned in between 'gdb' (GNU Debugger) and the actual
JTAGICE hardware and allows 'gdb' to single-step, set break points,
watch-points, etc, etc.  Just like debugging any remote target on Unix
- quite powerful and capable.  I've caught several elusive bugs using
this setup that defied my other usual techniques.

-Brian
-- 
Brian Dean
http://www.bdmicro.com/

Re: JTAG interface works even without MCU clock

2004-08-13 by Graham Davies

--- In AVR-Chat@yahoogroups.com, Brian Dean <bsd@b...> wrote:

> But if you are using a Mac, Linux,
> or FreeBSD, AVR Studio is not
> ... an option ... Windows-only.

True. I do not know what hosting platform the other person is using. 
He has bought one of my little JTAG-ICE units, though, and we may 
hear from him how he gets on with it.

> That's where AVaRICE comes in ...
> I personally use it ...

That's good to know. I assume you have a genuine ($300) Atmel JTAG 
ICE since you mention it on your Web site.

> ... quite powerful and capable. I've
> caught several elusive bugs ...

I don't know how people work without an in-circuit debugger. Many 
problems posted here and on other groups could be solved by the 
poster if they had an OCD/ICE. I think it is a failing of Atmel that 
they keep changing the debug interface and the ICE adapters are so 
costly. After a really bad experience with the original Z8 Encore! I 
must say I hate ZiLOG, but their one-wire debug interface is great. I 
make an adapter for that, too, and it's only $8.50. I think people 
starting projects should consider the ATmega series with JTAG 
interfaces so that they can use an in-circuit debugger, either with 
my adapter or one of the other JTAG ICE clones.

Graham.

Re: [AVR-Chat] Re: JTAG interface works even without MCU clock

2004-08-13 by Brian Dean

Hi Graham,

On Fri, Aug 13, 2004 at 08:30:55PM -0000, Graham Davies wrote:

> > That's where AVaRICE comes in ...
> > I personally use it ...
> 
> That's good to know. I assume you have a genuine ($300) Atmel JTAG
> ICE since you mention it on your Web site.

Yep, I've had it since before all the clones started showing up.  BTW,
thanks for visiting - I hope you liked what you saw.

> > ... quite powerful and capable. I've
> > caught several elusive bugs ...
> 
> I don't know how people work without an in-circuit debugger. Many
> problems posted here and on other groups could be solved by the
> poster if they had an OCD/ICE. I think it is a failing of Atmel that
> they keep changing the debug interface and the ICE adapters are so
> costly.

While $300 seems high, just think of the cost of not having one in a
production environment :-) Also note that $300 is an order of
magnitude less than typical ICE environments.

Even better are prices like yours, though, an order of magnitude less
than even that :-)

> I think people starting projects should consider the ATmega series
> with JTAG interfaces so that they can use an in-circuit debugger,
> either with my adapter or one of the other JTAG ICE clones.

The only thing I don't like about JTAG on the AVRs is that you have to
give up 4 pins to use it.  Other than that, it's great, and worth it's
weight in gold when you are faced with one of those tough bugs.

-Brian
-- 
Brian Dean
http://www.bdmicro.com/

Re: [AVR-Chat] Re: JTAG interface works even without MCU clock

2004-08-14 by Mike Murphree

On Aug 13, 2004, at 3:30 PM, Graham Davies wrote:

>
> --- In AVR-Chat@yahoogroups.com, Brian Dean <bsd@b...> wrote:
>
>> But if you are using a Mac, Linux,
>> or FreeBSD, AVR Studio is not
>> ... an option ... Windows-only.
>
> True. I do not know what hosting platform the other person is using.
> He has bought one of my little JTAG-ICE units, though, and we may
> hear from him how he gets on with it.

Well, it didn't get here today, maybe tomorrow...

I pretty much have all of the platforms mentioned above at my disposal. 
  I haven't built the AVR toolset for the PowerBook yet, but it's only 
about 3 commands away with Fink.  However I'm finding the PowerBook 
makes the ideal electronic databook,  I can set it on the same bench as 
the other computer and view a datasheet or manual at the same time.  
None of the other systems approach the readability of text that I get 
on a Mac...

I'd like to get AVRDUDE working with the Butterfly under Windows 
though, and noticed someone had submitted a patch for it a week or so 
ago.  Using AVRPROG in Studio requires about 3 hands to work through 
the menus, and hold and press the right buttons on the Butterfly at the 
same time.

Mike

Re: [AVR-Chat] Re: JTAG interface works even without MCU clock

2004-08-14 by Les Grant

On 13 Aug 2004 at 20:30, Graham Davies wrote:

> I don't know how people work without an in-circuit debugger. Many
> problems posted here and on other groups could be solved by the poster
> if they had an OCD/ICE. 

When you can't afford to lose the pins that JTAG demands, you learn 
to live without! ;-)  I always seem to end up with -5 pins left over 
after the initial design... ;-)

Regards,
Les.


-------------------------------------------------------------
Les Grant. VK2KYJ.      Phone: 02 9896 7150 Fax: 02 9896 7153
Grantronics Pty Ltd     Int'l: +612 9896 7150, +612 9896 7153
ABN 46 070 123 643
PO Box 275, Wentworthville. NSW. 2145. Australia.            
http://www.grantronics.com.au  mailto:info@grantronics.com.au
Microcontroller Hardware and Software development:  Atmel AVR
8051 derivatives, 80C196 family, C, ASM, Digital and analogue 
-------------------------------------------------------------
Australian distributor for:
o Dunfield Development Systems low cost development tools
o ImageCraft AVR and Motorola Windows-hosted C compilers
o ELNEC Device Programmers (E)EPROMs, Flash, Micros, PLDs
o CAN-BUS Hardware and Software from LAWICEL
o Logical Systems Programming, Prototyping & Production Adaptors
-------------------------------------------------------------

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.