how to debug the code

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

Hi guys,
i have Atmega128 . i connected an external 10-bit serial ADC to it. i want to debug the code that i have written. I have read some where about JTAG debugging.. Does that Debug the Code running inside the Atmega128?

Is there anyway to debug the code in real time.. i dont want simulated debugging like in AVRstudio.

Thank you..

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

Use the built-in UART of the AVR and just send some relevant output to any terminal you have at hand. No need to use/buy a JTAG debugger... You could even use some LEDs to show certain events and/or values, or an LCD...

Einstein was right: "Two things are unlimited: the universe and the human stupidity. But i'm not quite sure about the former..."

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

But you can buy a JTAG if you want. Because this is the old mega128 you have 3 options:

1) about $30 for a JTAGICE clone - supports about 10 AVR, one of which is mega128
2) $50 gets you the Atmel Dragon (also a programmer and supports debugging on all AVRs that can do debug)
3) $299 (sometimes on a $149 offer) gets you the Atmel JTAGICEmkII

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

Also if you are dealing with serial communication, it might be beneficial to get a logic analyzer.

This is the one that I have. It is very good.
www.sparkfun.com/products/8938

"Impossible Is Nothing"

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

Thank you guys.