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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/16/00 09:29
Read: times


 
#6540 - RE: External - 0 interrupt ??
On the 8052 simulator I have tried this.

Following ISR-1 does not work properly. It acknowledges at least one interrupt occurance even from inside the interrupt and being edge type.

///////////////////////////////////
;ex0 ISR-1
========
org 0003h

clr ex0 ; disable interrupt

Inc counter
mov a,counter
cjne a,#x,no_action

Action
sjmp exit
no_action
exit

setb ex0 ; re enable interrupt
reti
///////////////////////////////////

Following ISR-2 works properly and counts upto X. No need to disable and re enable interrupt. Just clear the flag if set due to any interrupt acceptance. This ISR leaves you ready for next intrrupt being outside.

///////////////////////////////////
;ex0 ISR-2
========
org 0003h

Inc counter
mov a,counter
cjne a,#x,no_action

Action
sjmp exit
no_action
exit
clr ie0 ; clear interrupt flag if any interrupt occured during ISR.
reti
///////////////////////////////////

I hope ISR-2 works in actual application also.

Simon

List of 15 messages in thread
TopicAuthorDate
External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      
RE: External - 0 interrupt ??            01/01/70 00:00      

Back to Subject List