Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/27/08 10:56
Read: times


 
#155145 - simulating Interupts in IAR
Can anyone tell me how to simulate interrupts (any timer0,timer1, or external) in IAR C-SPY debugger? is there any macro file needed for this? I am using IAR Embedded workbench for 8051 microcontroller (version 5.5 ). It is showing only updation of variable of main program but not of ISR. So to see that what setting I have to do?

my code is like this:

#pragma language=extended
#include "io51.h"

int result;
int rtime;
unsigned int count;
/* Example interrupt handler for the timer */
interrupt [11] void timer_int( void)
{
TMOD &= 0xF0; /* set timer mode */
TMOD |= 01;
TH0 = 0xff; /* interrupt rate*/
TL0 = 0x05;
TCON.4 = 1; /* turn on timer */
IE.1 = 1; /* set timer interrupt flag */
EA = 1;
rtime++;
P0.1 ^= 1;
count = P0; /* toggle port 0 bit */
}

void do_foreground_process(void)
{
result++;
}

void main(void)
{
TMOD &= 0xF0; /* set timer mode */
TMOD |= 01;
TH0 = 0xff; /* interrupt rate*/
TL0 = 0x05;
TCON.4 = 1; /* turn on timer */
IE.1 = 1; /* set timer interrupt flag */
EA = 1; /* enable the interrupts */
while (1)
{
do_foreground_process();
}
}




No replies in thread

Back to Subject List