Problem with debbug in AVR studio

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

Hello
Under debbug in first loop AVR studio not refresh status of register of PORTC marked on red. When it execute and go second time then its OK - PORTC show good values. Please see photo - PORTC will be 0x56 but not 0x00 in this time!!! What happens????

device ATMEGA16A
AVR Studio version 4.18 build 716
version AVRGCC: WinAVR20100110

my code:


#define F_CPU  12000000 
#include  
#include  

int main (void) 
{ 

 int licznik; 
for (licznik=0;licznik<256;++licznik) 
{ 
_delay_us(100); 
PORTD = licznik; 
} 

unsigned char counter; 
counter = 1; 
//set PORTB for output 
DDRC = 0xFF; 
while (1) 
{ 
 PORTC = 0x55; 
 PORTC = 0x56; 
 PORTC = 0x57; 
 PORTC = 0x58; 
 PORTC = 0x59; 
 PORTC = 0x60; 
 _delay_us(1); 
 PORTC = 0xAA; 
 _delay_us(1); 
} 
return 1; 
} 

and results of builds :


Build started 7.1.2011 at 14:28:03

AVR Memory Usage
----------------
Device: atmega16a

Program:     186 bytes (1.1% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)


Build succeeded with 0 Warnings...

Last Edited: Tue. Jan 11, 2011 - 12:59 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
//Set PORTB for output
DDRC - 0xFF;

eh? No compiler warning?

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

I corrected DDRC - 0xFF to DDRC = 0xFF; and I have the same problem.

Any solitions ????

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

Disable optimization & see what happens!

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?