Can an interrupt of higher natural priority interrupt one of lower priority? For the time being my question is limited to the case where none of the interrupts' priorities are promoted in the IP. I'm using the Dallas DS80C320 part. I have tried a variety of hardware experiments which suggest that a higher natural priority interrupt CANNOT interrupt one of lower priority but these experiments have not been conclusive (i.e. I have not seen a higher priority event interrupt a lower priority event on my emulator). From what I've observed it seems that the priority scheme only affects which interrupt runs first if both occur during the same machine cycle. In that case both run sequentially, higher priority first, returning to execute one line of code, then second priority. However I'm not entirely confident that I've covered all the possible use cases. I have not been able to get a straight answer from the part vendor (Dallas). They have suggested that the LJMP from the interrupt event to the ISR vector can itself be interrupted. This seems wrong. The reason for this question is that I've ported the uC/OS multi-tasking operating system to my part and I've experienced some intermittent problems when external interrupts are introduced into the system. The OS relies on a CPU context dump to XDATA being performed upon entry into an ISR and this sequence cannot be interrupted, hence my question. I'd appreciate input from anyone with more experience on this part or with '51 interrupts in general. Thanks in advance, Chip Burns
Hi, A low priority interrupt can be interrupted by a high priority interrupt BUT this is acheived by setting it to high priority in the Interrupt priority (IP) register. If two interrupt requests of different priority levels are received simultaneously, the request of higher priority is serviced. If two interrupts of the same priority level are received simultaneously, an internal polling sequence determines which request is serviced. The interrupt polling sequence (from highest to lowest) is:- INT0 TF0 INT1 TF1 RI and TI This is for the 8051 and taken from a Philips data book!. I think that after the interrupt system generates an LCALL to the appropriate vector it cannot be interrupted unless you have set some to be of higher priority in the IP register. Hope this helps, Mark.