How much faster is debugging with JTAG ICE?

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

How much faster is debugging with JTAG ICE compared to debugging without an emulator? This is my first project and I'm just printing error messaages on an LCD display and it's really a slow process.

Lars

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

I've gone the other way. I used to use my ICE200 for everything, but recently I've been working with controllers that the ICE200 doesn't support, so I've been using LCDs, VFDs, or the UART for giving my information during debug. Before, I would have said I'd rather chew off my own foot than develop something without an ICE, but I think the indications given on the LCD, VFD, or UART are good for all but the most bizarre of problems. The only problem is you have to take out all the debugging code when you're done. Or else, if you're using C, you can always put
#if DEBUG

#endif
around all your debugging code.

I don't know about JTAG specifically, but I'd say it's probably about the same.

fwiw,

j.

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

Can you attach the code you use to send the debug info from the AVR device to the PC using the USART? What program do you need in the PC to receive the debug info from the target system (and thereby communicate with the AVR)? Is there anything JTAG ICE can do that AVR-JTAG can't do? AVR-JTAG from Olimex (Bulgaria) only costs $39.95.

Lars

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

Hi mate...

here is a usefull tips to be able to use a fully compable printf function which disapear when compile is release mode instead of debug mode

#ifndef DEBUG_MODE
#define DEBUG_MODE 1
#endif

#if DEBUG_MODE
#define dbg_printf printf
#else
#define dbg_printf 1>0 ? (void)0 : (void)printf
#endif

use the dbg_printf macro the same maner as the true printf function...

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

The thing with any computer or micro-controller is you have inputs, from pushbuttons, keyboards, or something brought in form somewhere on the internet. Then you have the output, a lite, a motor, file, printer, whatever.

You can have your code give an indication of where it is at and/or what it is doing by lighting a lite, something on an LCD or send text to a computer screen via USART. I just use what I have as the input and output indication of what is going on and piece by piece, line by line, I find the problem. Call it what you will but this is debugging.

Now, is an ICE faster? I have know idea.

Mike

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

JTAG ICE is not only faster but more reliable as well. U gain much more controll over your design all the way down to single port pin controll, U can at any time read the contents of almost all registers or change register contents, port pin status or port pin direction / pullup. The disadvantage is that you only have 4 breakpoints available and that the Avr studio chan be a challange to live with, but its getting better. Furthermore, you can only use JTAG enabled devices, or devices with the new debug wire. (Using JTAG ICE mk2). The price, however, is ,, ok.

Debuging through a display... Not for this guy...

Z

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

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

mikl wrote:
Hi mate...

here is a usefull tips to be able to use a fully compable printf function which disapear when compile is release mode instead of debug mode

#ifndef DEBUG_MODE
#define DEBUG_MODE 1
#endif

#if DEBUG_MODE
#define dbg_printf printf
#else
#define dbg_printf 1>0 ? (void)0 : (void)printf
#endif

use the dbg_printf macro the same maner as the true printf function...

This actually works

Just made this test

#include 

#define DEBUG_MODE 0

#ifndef DEBUG_MODE 
#define DEBUG_MODE 1 
#endif 

#if DEBUG_MODE 
#define dbg_printf printf 
#else 
#define dbg_printf 1>0 ? (void)0 : (void)printf 
#endif 

void main(void)
{
	printf("hello world");
	
	dbg_printf("hello debug world");
}

If i #define DEBUG_MODE 0 , the dbg_printf line "disappears" , if i dont. It generates code.

Just verified by the listings file.

Can anyone explain what happens in this line

Quote:
#define dbg_printf 1>0 ? (void)0 : (void)printf

does (void)0 "eat" until EOL ???

/Bingo

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

As I see it, the ICE/JTAG debugging method offers so much more.

With and ICE, the code runs in real time, until a breakpoint is met. If you are using the AVR for realtime control then printf's can really screw things up.
The code isn't littered with redundent printf code. And, if you up against the FLASH limits of the AVR then this can make a big difference.
With an ICE, you can step through the code looking at all the variables, registers & IO etc.
For printf, you need a spare UART, again, this might no be available, Ok, the JTAG interface uses some IO pins, but this may be less of a problem.

NO CONTEST!

You can build a ICE for a few quid, look for BOOTICE in the forums.

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

U're prob right but all i needed was an ansver to the C macro thing i posted 8) 8)

/Bingo

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

Of course a real ICE like the ICE200 (Ice 40 or 50) emulates the chip fully i.e. you don't lose 4 pins of your chip to the JTAG ice 8) . I could not work without some form of in circuit emulator as I have been spoilt for some 20 years using one for one processor or another. A simple Monitor program can be very useful and I have used some with Motorola chips but haven't tried the one for Atmel (I believe there is one floating around) because I have the wonderful ICE200 (bugs and all) :D to work with. Of course developing code for larger processors (>8K) cannot be done easily but at least one can test portions of the code fully and it is still very useful with chips like the 8535, 8515, 2313 and even the M8 which is pretty much all I use at this point.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly