I'm trying to follow this tutorial so I reckon the stuff I'm trying should work.
Here'se the code, it's not working as expected and it's driving me nuts.
DDRB = 0xFF; // Data direction for pins on PortB = output
PORTB ^= 1 << PINB0; // toggle PortB Pin0
In the tutorial, the code is compiled and uploaded to the chip and seems to run (led is indeed blinking).
I'm trying to simulate this in Atmel studio 6.2. I set a break point in the while-loop and it breaks once only.
After that, it doesn't break anymore and the IDE is just "Running". The registers are not changing.
I found a few tutorials on this, seems to be kind of "Hello World" of pin-toggling. None of the variations I tried works for me though (for pin 0).
The closest I've gotten is with:
PORTB ^= 0xFF; // working, toggles all pins on PortB
PORTB ^= 0x80; // working, toggles the 8'th pin only
Is it a bug in the simulator or am I doing it wrong?