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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/18/01 23:07
Read: times


 
#13318 - RE: Handling multiple interrupts with Keil C
When you say "and during INT0, I setup Timer0 to interrupt the INT0 interrupt" are you saying that you're in INT0, you set T0 to interrupt, and you remain in INT0 while T0 interrupts INT0? If so, does the problem occur just by enabling the Serial interrupt, or only when there is incoming traffic on the serial port?

What I'm wondering is if you are trying to handle three simultaneous interrupts?

For example, if you are in the middle of a serial interrupt which is interrupted by INT0, and while in INT0 you configure T0 to provoke interrupts, the T0 interrupt will never occur until you exit the INT0 interrupt. That's because an interrupt can only interrupt an interrupt of lower priority. Assuming your serial port has priority 0, your INT0 has priorty 1, nothing is going to be able to interrupt INT0 until it finishes (unless you're using a derivative that has 4 priority levels).

In your second message you mentioned that your serial port and INT0 were both priority 0 and your timer was priority 1. This would mean that INT0 is never going to execute while a serial interrupt is ocurring (i.e., the serial interrupt will finish first and when it finishes the INT0 interrupt will occur).

Make sure that both TI and RI bits are clear before starting your cycle. Also make sure you are using RETI to exit your ISRs. You're using 'C', so this should be handled automatically by using the "interrupt" keyword in Keil.

If none of the above helps, you might want to consider posting your entire interrupt initialization *and* interrupt service routine codes so we can better see what's going on.

Craig Steiner


List of 6 messages in thread
TopicAuthorDate
Handling multiple interrupts with Keil C            01/01/70 00:00      
RE: Handling multiple interrupts with Keil C            01/01/70 00:00      
RE: Handling multiple interrupts with Keil C            01/01/70 00:00      
RE: Handling multiple interrupts with Keil C            01/01/70 00:00      
RE: Handling multiple interrupts with Keil C            01/01/70 00:00      
RE: Handling multiple interrupts with Keil C            01/01/70 00:00      

Back to Subject List