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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/03/09 14:44
Read: times


 
#163022 - Interrupt Service Routine (ISR) Problem
I am implementing my LED Display code with a timer interrupt as simple code without ISR did not work for me (as more characters came, their scrolling speed also reduced).
So i put the loading of next character in the ISR.
void timer0() interrupt 1{
TR0=0;
for (col=0;col<5;col++)
{
row_buff[d]=row_data[row][col];

 P1_1=row_buff[d] ;
 //clock
 P1_2=0;
P1_2=1;
 d=d+1;
 }//for col

}
void main()
{
IE=0x82; //enable interrupt for timer 0
TMOD=0x02;
TH0=0xFE;
TL0=0xFE;


while (1)
{......

 


I have switched off the timer in ISR because TH0=0xFE and TL0=0xFE,so that
the overflow should not occur before end of ISR.

You can well imagine that the interrupt will occur as soon as timer is switched ON (that what i want).


Now the errors:
While compiling:

Build target 'Target 1'
compiling scroll_final.c...
linking...
Program Size: data=50.0 xdata=0 code=1398
creating hex file from "scroll_final"...
"scroll_final" - 0 Error(s), 0 Warning(s).


As i put keil in simulation/debug mode and RESET and Run,it stops immediately:
the yellow arrow pointing to error:

C:0x0005 00 NOP IE(0xA8),#DP0L(0x82)

And error in Output window:

*** error 65: access violation at C:0x0005 : no 'execute/read' permission

And when i execute statements one by one then it shows that the error occurs as soon as
ISR is over and instead of coming back after executing ISR, it gives me this error.
Any help??





List of 3 messages in thread
TopicAuthorDate
Interrupt Service Routine (ISR) Problem            01/01/70 00:00      
   Come on guys....            01/01/70 00:00      
      Sparse information            01/01/70 00:00      

Back to Subject List