Debugging questions (mostly)

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

I am an experienced software developer, but about a week into the embedded world. I've been doing a lot of reading to prepare for a project based on an AVR 8-bit uC with USB (very likely the AT90USB162 or 82). I don't have any hardware yet... I'm trying to figure out what I need and how I'll use it all. I'd appreciate any help with the following questions:

  • It isn't clear to me why I would use the AVR Dragon vs the JTAGICE mkII. Documentation on the dragon is pretty thin and I don't understand how the two are different (other than cost).
  • It looks to me like both the dragon and jtagice use the OCD feature on the AVRs. Why then do the docs for both say things like "Emulates Digital and Analog On-Chip Functions". What is being emulated? Aren't they just interfacing with the actual chip? Or is "emulate" in this case just a way to say "not simulation"?
  • Does anyone still use tradition ICE emulators with AVRs? I think OCD + simulation would cover most of my needs.
  • I haven't found anything in the AT90USB82/162 datasheets about hardware (register) breakpoints. Do these devices have them?
  • Does AVR Studio + WinAVR + debugWire allow for symbolic debugging of C code during "emulation"? I see that is works in the simulator, but don't have hardware yet.
  • Any idea when the avr-gcc bundled with WinAVR will support the USB82/162? I found commits to avr-gcc for this, but they are very recent and not bundled with WinAVR yet. Actually even the latest AVR Studio beta lists the USB162 but not the 82. Am I a bit early for the 82?
  • How does one program the finished devices efficiently if you need to make thousands or tens of thousands? Hooking up an ISP to each one would be impractical. I guess there must be 3rd parties with fancy equipment that can do this out-of-circuit? I can't picture how you'd quickly mount a QFN 32 out of circuit without automation.
That's it for now... thanks for the help.

-Brad

-Brad

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

Dragon is a 'naked' board, you have to add your own sockets, case, etc. It is designed to be low cost. I have one but haven't played with it yet, so instead of saying something stupid I'll stop here.

The JTAGICE MkII is a finished box with accessories. Totally turnkey. I have one and use it. The cable is somewhat delicate, so I also use an AVRISP MkII when I don't need debugging. Digikey is running a deal on JTAGICE with an STK500, and it is worth doing as it saves a far bit of change over the regular price.

As to the programming of thousands... maybe that is a good question for your assembly house? FWIW, when I get to moderate volumes, my plan is to build a simple fixture using pogo-pins to bridge over from an AVRISP, and on the product simply lay out pads for the requisite signals for in-circuit programming. Not totally automated, but no plug/unplug operation either, and no connector in the BOM.

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

I'll try to answer a few of your questions:

Quote:
It isn't clear to me why I would use the AVR Dragon vs the JTAGICE mkII. Documentation on the dragon is pretty thin and I don't understand how the two are different (other than cost).

Functionally the difference between the Dragon and the mkII is that the Dragon is limited to devices with 32KB program memory.

Edit: Also the Dragon can perform High Voltage Programming which the mkII cannot.

However, practically, unless you're limited by cost, then the mkII is more usable as it is packaged in a case and much more robustly constructed. There have been a number of reports on AVRFreaks of Dragons blowing smoke.

Quote:
It looks to me like both the dragon and jtagice use the OCD feature on the AVRs. Why then do the docs for both say things like "Emulates Digital and Analog On-Chip Functions". What is being emulated? Aren't they just interfacing with the actual chip? Or is "emulate" in this case just a way to say "not simulation"?

During debugging the AVR performs all operations and then the registers/SRAM are read back upon a breakpoint being encountered.

Quote:
I haven't found anything in the AT90USB82/162 datasheets about hardware (register) breakpoints. Do these devices have them?

There is a difference between JTAG debugging and the Debugwire debugging in that only JTAG uses the hardware breakpoint registers. Debugwire rewrites the flash at the breakpoint location with a break instruction so flash is changed each time you add or remove a breakpoint.

The devices you mentioned do not support JTAG debugging.

Last Edited: Tue. May 8, 2007 - 05:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I enquired as to the per thousand cost of having SMD ATMega168s pre-programmed by Atmel, suffice it to say it ain't happening!
The USB product I just completed, currently being built in China, will have them bootstrap it via AVRISPII and an STK500.exe script with a USB bootloader and production soak/diagnostics code (manually merged hex file :P )
Then when the boards are received we can easily get the product in which the board goes to load the application firmware via the USB bootloader.
Tedious but least-cost for this project.

I have coded for about 2 dozen architectures, and they all have their place.
Don't get too religious about them (but AVR is excellent!)

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

Thanks for the feedback. Any word on the following question? I'm finding conflicting info on the net:

Quote:
Does AVR Studio + WinAVR + debugWire allow for symbolic debugging of C code during "emulation"? I see that is works in the simulator, but don't have hardware yet.

-Brad

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

Quote:

I enquired as to the per thousand cost of having SMD ATMega168s pre-programmed by Atmel, suffice it to say it ain't happening!

We had it quoted by a couple of US distis, and it wasn't prohibitive. IIRC it was about US$0.30/chip on Mega8s when they were going for about US$3 in quantity.

Also, many board houses will have facilities to program the chip on the way to being placed.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Quote:
Does AVR Studio + WinAVR + debugWire allow for symbolic debugging of C code during "emulation"? I see that is works in the simulator, but don't have hardware yet.

Yes... it provides source level debugging. You can set a breakpoint on a line of source code. As with any optimizing C compiler sometimes optimizations can restrict with that ability.