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 Priorities in 16F877

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



Joined: 19 Jul 2004
Posts: 33

View user's profile Send private message

Interrupt Priorities in 16F877
PostPosted: Mon Oct 04, 2004 9:42 pm     Reply with quote

Hi..Can anybody answer it..??

How can we know, whether there is interrupt
priority facility/property in perticular
processor or not..??

Is there Interrupt Priority property in 16F877?

If yes, I have one question,
If we have more than one interrupts and we have also
set the interupt priorities for all.
Does the Interrupt Priority change by any programatic
reason..?? e.g Does the Interrupt Priority change,
if we disable and enable the lower priority interrupt
in between the code..??
If it is changed, what can be the priorities after
disabling the low priority interrupt? And what
will be its priority after enabling it programatically
in between the code?

And same for first priority interrupt..??

Any answer appreciated....

Regards
Prashant
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: Mon Oct 04, 2004 10:03 pm     Reply with quote

There are hardware and software interrupt priorities. The PIC 16F877 (and variants) has a single hardware interrupt priority. The 18F452 has high priority and normal (low) priority hardware interrupts.

The CCS compiler provides support for software interrupt priorities which basically determines the order that interrupt handler determines which source of interrupt to process first. A low priority interrupt handler cannot be interrupted by another low priority interrupt. CCS does not support SW interrupt priorities for the PIC18F hardware high priority interrupts. CCS supports a single interrupt handler for hardware high priority interrupts via the use of the 'fast' keywork.

So - for a PIC16F877 you use the CCS interrupt priority mechanism to prioritize which interrupt source is tested first and therefore which handler gets first crack at the interrupt processing.

With the PIC18F you has a HW high priority interrupt which, if enabled, will interrupt a low priority interrupt handler. You have no way of defining multiple interrupt handlers for high priority interrupts unless you use assembler - even there these is some fighting to be done with the CCS compiler to let you do this. SW interrupt priorities can still be used with the low priority interrupts as per the PIC16F877.
Prashant Patel



Joined: 19 Jul 2004
Posts: 33

View user's profile Send private message

Thanks..
PostPosted: Tue Oct 05, 2004 2:48 pm     Reply with quote

Thanks..thats great answer...
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