Hi. I Think I have found a bug on atmega 128. Here is the situation:
I have some RANDOM erratics values on R10 and r11 on my Timer Interrupt 1. After long debug, I have conclued of a problem on these two registers on the Atmega 128.
here is my code.
First, I initialise all my Timer interrupt 1 routine and also the STACK. After All that, a put an Endless loop on the main program like that:
in my Interrupt routine, I have this code:
ldi r10,0xff ;init the two registers to 255
; here is the test routine just to know if the CPU is doing something
;here is the trap to see if there is a problem with r10 and r11
Now, Guess what? I monitor the PORTA output, and after a random short time, it stop to increment.
But when I make the same thing in the avr studio simulator for 2 entire days, All is OK.
If someone can confirm me if it's a known problem with the atmega128 or any other atmega, please, let me know... Otherwise, Will I have to send it to Atmel?