View previous topic :: View next topic |
Author |
Message |
Prashant Patel
Joined: 19 Jul 2004 Posts: 33
|
Interrupt Priorities in 16F877 |
Posted: Mon Oct 04, 2004 9:42 pm |
|
|
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: 1635 Location: Perth, Australia
|
|
Posted: Mon Oct 04, 2004 10:03 pm |
|
|
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
|
Thanks.. |
Posted: Tue Oct 05, 2004 2:48 pm |
|
|
Thanks..thats great answer... |
|
|
|