CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Interrupt handling

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
xpercad
Guest







Interrupt handling
PostPosted: Thu Jun 24, 2004 5:53 pm     Reply with quote

I am using PIC18F452 and PCWH 3.202 and two interrupt sources (INT_EXT0 and TIMER_0).

INT_EXT0 is used for servicing an SPI interfaced decoder, and TIMER_0 is used for timing functions. My application requires that the service routine for TIMER_0 should be interrupted if INT_EXT0 becomes active. The service routine for INT_EXT0 is not "very" fast and a bit complex. From what I have read, using the FAST directive is a dangerous matter.

Can anybody shed some light as to how to handle this situation ???

Any kind of help will ge highly appreciated !!!

Aaron
Ttelmah
Guest







Re: Interrupt handling
PostPosted: Fri Jun 25, 2004 2:37 am     Reply with quote

xpercad wrote:
I am using PIC18F452 and PCWH 3.202 and two interrupt sources (INT_EXT0 and TIMER_0).

INT_EXT0 is used for servicing an SPI interfaced decoder, and TIMER_0 is used for timing functions. My application requires that the service routine for TIMER_0 should be interrupted if INT_EXT0 becomes active. The service routine for INT_EXT0 is not "very" fast and a bit complex. From what I have read, using the FAST directive is a dangerous matter.

Can anybody shed some light as to how to handle this situation ???

Any kind of help will ge highly appreciated !!!

Aaron

FAST, is OK, _provided you have a recent chip_. The problem is that there is a hardware fault with the first couple of years production of the chips, which prevents fast interrupts from reliably working where the source is asynchronous (an external event is).
Also when using fast, you become responsible for saving and restoring the registers.
Given the event is not 'very' fast, can't you just rely on the normal handling?. If you use the priority statement, the external interrupt can be set to be handled 'ahead' of the timer interrupt. Alternatively, assuming your interrupt routines are well written (_short_), perhaps only setting a flag, then add a test at the end of the timer routine, and if the external interrupt has occured set the flag for this here, and clear the interrupt flag, which avoids the time delay involved in exiting this routine before the second interrupt handler is called.

Best Wishes
xpercad
Guest







PostPosted: Fri Jun 25, 2004 8:25 am     Reply with quote

Thanks a lot for your advise and best wishes to you too !!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group