atmel studio simulator

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

I created a sample project in Atmel Studio 7, and tried to run it using the simulator. Although I saw a status of running at the bottom of the screen, after a few clicks on step into I can saw that portc is being updated. But the button is not active any more. The Memory4 window had a message of "Unavailable when debuggee is running." I have enclosed screen captures of what I saw. The code was:

 

#define F_CPU 16000000UL
#include <avr/io.h>
#include "util/delay.h"

void Wait()
{
    uint8_t i=0;
    for (;i<23;i++)
    _delay_loop_2(0);
}

int main(void)
{
    /* Set PORTC0 as output */
      DDRC=0b0000001;
    while (1)
    {
        //Set PC0=High (+5v)
        PORTC= 0b0000001;
        Wait();
        
        //Set PC0=Low(GND)
        PORTC&=0b1111110;
        Wait();
    }
}

 

I am new to Atmel Studio, and I thought by using the simulator I would see an interface similar to Android Emulator which presents a visual pic of your code's outcome. In my case, I configured a ATmega32 target board.

So my question is basically how can I continue the debug session until I stop it myself; i.e. how do I get rid of the error message stated above and what does it mean?

Last Edited: Sun. Feb 21, 2016 - 02:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think its telling you the memory window only gets updated when the code is stopped.

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

Thanks. Is that the reason for the debug session to stop also? My limited experience with debugging is that I am able to keep running the application until I stop it myself.
 

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

Try "Pausing" the debug session, not "Stopping". Thereafter single-step if you'd like.

 

If you are so new to the job, I'd recommend beginning with an AVR/Arduino.