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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/02/02 11:31
Read: times


 
#30020 - RE: software interrupt
as for a genuine software interrupt I use them often. One example is to fetch incoming UART data at a high priority and process it at a priority between hardware interrupts and main.

This example uses timer 2 as a software interrupt, any/most interrupts can be used

In init set all interrupts except timer 2 to a priority other than lowest (0) (modern derivatives 1,2,3, oldies 1).

UART ISR:
; fetch byte to circular buffer, then
setb TF2
reti

then in the timer2 ISR process the byte(s)

OOPS, Sriharsha, your code

ljmp your_routine
reti
....
your_routine:
; your routine code goes here and finally
ret


should be either

1) lcall your_routine
reti
....
your_routine:
; your routine code goes here and finally
ret

or
2) ljmp your_routine
;something else
....
your_routine:
; your routine code goes here and finally
reti


Erik



List of 4 messages in thread
TopicAuthorDate
software interrupt            01/01/70 00:00      
RE: software interrupt            01/01/70 00:00      
RE: software interrupt            01/01/70 00:00      
RE: software interrupt            01/01/70 00:00      

Back to Subject List