debug print through JTAG in AVR studio 4

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

Hi there!

i've used ATMEGA for several years now with codevision, and i just switched to the new ATXMEGA128A1 device, and i took this oportunity to also switch to AVR Studio with WinAVR.

I'm using a JTAG ICE mkII.

My question is :
is it possible to use a print function that will use the JTAG connection to display a message in AVR Studio or in a terminal, but WITHOUT using another RS232 COM port and UART?
If this is not clear, i reformulate : can I send characters from the ATXMEGA through the JTAG port to the PC ?

I know this may sounds like a newbie question, but i've been looking for this info for hours now, and i begin to doubt this is possible.

Can anyone help?
Thanks !!

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

Quote:

is it possible to use a print function that will use the JTAG connection to display a message in AVR Studio or in a terminal, but WITHOUT using another RS232 COM port and UART?

Nope. The closest thing you've got is (in old school AVRs) the OCDR register. In theory this allows you to set a number between 0x00 and 0x7F which will appear in a message in AVR Studio. So you could litter your code with "checkpoints" and at decision point 57 use something like "OCDR = (1<<IDRD)+57;". This *should* make the debugger output a message to say that 57 (0x39) has been received.

Only thing is I've NEVER managed to get this to work and I've never read a post from anyone else suggesting they have.

Perhaps Atmel have surprised us in the Xmega (assuming a similar facility is advertised?) and finally made this work?

For now use UART or SPI or an LCD and printf() to it.

(having said that, if you are JTAG debugging why would you need such a comms. channel anyway? Rather than "printf("x=#u", x)" you might as well just stop execution at that line and inspect what's in 'x')

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

Thank you so much for this fast and precise answer.
It is true that i can stop the program and watch, but i usually use a external uart to monitor stuff while the code is running. I guess i'm gonna stick to the uart.
Thanks again !

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

I guess the joy of Xmega is that you have any number of UARTs to choose from ;-)

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

...even if you can't choose any of the Xmegas... :wink:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

clawson wrote:
The closest thing you've got is (in old school AVRs) the OCDR register.
The Obsessive-Compulsive Disorder Register? :twisted:

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!