hi:
my simulator object is Atmega8 and my code below:
#include<iom8.h>
#define __enable_interrupt() SREG |= 0X80;
#define __disable_interrupt() SREG &= 0X7F;
#pragma vector= TIMER0_OVF_vect
//timer overflow function, name doesn't matter.
__interrupt void timer_overflow(void)
{
//LED toggle
PORTB ^= 1 << 3;
}
int main( void )
{
SP = 0x45F;
TCCR0 = 0x00; // normal operation (mode0);
TCNT0=0x0000; // 8it counter register
TCCR0 = 0x05; // start timer/ set clock/ prescalaer - 1024
TIMSK=0x01; // enabled timer overflow interrupt;
DDRB=0x08;
//global interrupts are enabled,
__enable_interrupt();
while (1) {
}
}
I set a breakpoint in the interrupt code ,but the IAR simulator always run and not stop at the breakpoint.why?