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 CCS Technical Support

Service one interrupt within another

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



Joined: 05 Sep 2007
Posts: 46
Location: Londrina - Brazil

View user's profile Send private message

Service one interrupt within another
PostPosted: Fri Jan 09, 2009 11:51 am     Reply with quote

HI.

In my application I have external interrupt enable. I also have the RDA interrupt enable, for receiving serial data from USART.

I need that the RDA interrupt keeps working (interrupting), while INT_EXT code is executing. Is that possible?

If not, any alternatives?

PIC is 16F876.

Thanks.
_________________
Give a man a fish and you'll feed him for a day. Teach a man to fish, and you'll feed him for a lifetime.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Jan 09, 2009 12:01 pm     Reply with quote

If you use a PIC18F or PIC24F you can have multiple interrupt priorities. In this case high priority interrupts can interrupt low priority interrupts.

Failing that, you need to look at the toime you are spending in the interrupt hanlder. The serial interrupt is generally forgiving because if an interrupt even occurs inside the interrupt handler you have an entire character time to finish processing the external interrupt before the next character is received and an interrupt generated.

Does you external interrupt process take longer than a character time? If so - perhaps you should look at how to move the processing into the main bodey of code such that the external interrupt handler merely sets/clears flags for subsequent processing in the main code body.

Alternatively, you could sample the serial interrupt flag multiple times within the external interrupt handler if necessary to process a character. If you are using a ring buffer for receiving incoming data (no serial command processing in the serial interrupt handler) then this approach may be suitable.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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