AVR Studio 5 and ATmega2560 - debug options

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

Hi everybody,
I'm having problems to do a debug session on AS5, (comparing to the previous version, Studio 4)

I want to debug a code using AVR simulator, and studio 5 says it's "not supported" for ATMEGA2560, but version 4 does support that micro.
¿is that an error on my configuration??

The idea is to debug an USART ISR, right now I can only do that using jtagice mk2, and is not the best method to do that, half of the transmissions to the USART are missed because the mk2 is processing who knows what, and I'm unable to generate interruptions through the avrstudio 5 (AS4 let me do that)

I'll appreciate any help.
Regards

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

Quote:

I'm having problems to do a debug session on AS5, (comparing to the previous version, Studio 4)

Then use AS4 until they finish AS5? As for Studio 4 not supporting 2560 - that's simply not true. It's been supported by many recent versions and is most definitely there in the "current" version 4.19

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

A correction to the last post.
I guess I can generate interruptions, but what I can't do is to force a value on UDR0 and that value get assigned to a variable on the code, example:

FRAME_IN[COUNTER]=UDR0;

After put my value on UDR0, and press F11 to run that statement, y can see on the "watch window" that the value is not assigned.
any idea?

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

Then just stub the UART receive function with something that returns the next element from a const array for the testing of the program?

Anyway UART is so simple it's almost impossible to get it wrong - so why do you need a JTAG to "debug" it anyway?

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

clawson wrote:
Quote:

I'm having problems to do a debug session on AS5, (comparing to the previous version, Studio 4)

Then use AS4 until they finish AS5? As for Studio 4 not supporting 2560 - that's simply not true. It's been supported by many recent versions and is most definitely there in the "current" version 4.19

due that, I'm using the version 4...
Let me clarify, I can debug that micro using JTAGICE mk2 on V5, I can do everything.... but the avr simulator.
That's why I was not sure if my configuration was wrong.

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

If you are talking about simulating UART then just forget it. Either that or add Hapsim to AS4 or explore VMLab.

Anyway 99.9% of the reasons for UART not working are timing issues and the simulators are notoriously bad at being able to do anything about simulating that. The key to making UART work is to use a reliable clock source (crystal not internal oscillator), make sure the clock source fuses are set right and make sure CKDIV8 is not active (or over-ride it with CLKPR).

Last Edited: Sat. Oct 15, 2011 - 03:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Then just stub the UART receive function with something that returns the next element from a const array for the testing of the program?

I didn't understand that, could you explain a little more please?
clawson wrote:

Anyway UART is so simple it's almost impossible to get it wrong - so why do you need a JTAG to "debug" it anyway?

I only want to debug my ISR routine, that it's not that simple (at least for me), I'm using studio 4 to that job...but the problem reading the UDR0 persists.

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

clawson wrote:
If you are talking about simulating UART then just forget it. Either that or add Hapsim to AS4 or explore VMLab.

ahhhh... ok! thanks for that!

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

Quote:

I didn't understand that, could you explain a little more please?

unit8_t UART_receive(void) {
  uint8_t dummy_data[] = { 'H','e','l','l','o',0x3C, 0x7D, 0x55 };
  static int index;
  uint8_t retval;
  retval = dummy_data
; index++; if (index > 7) { index = 0; } }

Which just feeds the next value from the array each time it is called.