section 7 - Index of

section 7 - Index of section 7 - Index of

11.07.2015 Views

second instruction of the downloaded code at P:$0001 of the internal RAM. However, theANDI instruction allows the OMR to be changed before the JMP instruction uses it, andthe JMP fetches P:$OOOO of the internal RAM.Case 4: An interrupt has two additional control cycles that are executed in the interruptcontroller concurrently with the fetch, decode, and execute cycles (see Section 7.3 andFigure 7-4). During these two control cycles, the interrupt is arbitrated by comparing theinterrupt mask level with the interrupt priority level (IPL) of the interrupt and allowing ordisallowing the interrupt. Therefore, if the interrupt mask is changed after an interrupt isarbitrated and accepted as pending but before the interrupt is executed, the interrupt willbe executed, regardless of what the mask was changed to. The following examples showthat the old interrupt mask is in effect for up to four additional instruction cycles after theinterrupt mask is changed. All instructions shown in the examples here are one-word instructions;however, one two-word instruction can replace two one-word instructionsexcept where noted.1. Program flow with no interrupts after interrupts are disabled:-ORI #03,MRINST 1INST2INST3INST4;Disable interrupts2. The four possible variations in program flow that may occur after interrupts aredisabled:ORI #03,MR ORI #03,MR ORI #03,MR ORI #03,MRII (See Note 2) INST 1 INST1 INST 111+1 II INST2 INST2INST 1 11+1 II INST3 (See Note 1)INST2 INST2 11+ 1 IIINST3 INST3 INST3 11+1INST4 INST4 INST4 INST4

Note 1: INST 3 may be executed at that point only if the preceding instruction (INST 2)was a single-word instruction.Note 2: 1I=lnterrupt instruction from maskable interrupt.The following program flow will not occur because the new interrupt mask level becomeseffective after a pipeline latency of four instruction cycles:ORI #03,MRINST 1INST2INST3INST4II11+ 1;Disable interrupts.;Interrupts disabled.;Interrupts disabled.1. Program flow without interrupts after interrupts are re-enabled:ANDI #OO,MRINST 1INST2INST3INST4;Enable interrupts-2. Program flow with interrupts after interrupts are re-enabled:ANDI #OO,MRINST 1INST2INST3INST4II11+ 1;Enable interrupts;Uninterruptable;Uninterruptable;11 fetched;11+ 1 fetched

second instruction <strong>of</strong> the downloaded code at P:$0001 <strong>of</strong> the internal RAM. However, theANDI instruction allows the OMR to be changed before the JMP instruction uses it, andthe JMP fetches P:$OOOO <strong>of</strong> the internal RAM.Case 4: An interrupt has two additional control cycles that are executed in the interruptcontroller concurrently with the fetch, decode, and execute cycles (see Section 7.3 andFigure 7-4). During these two control cycles, the interrupt is arbitrated by comparing theinterrupt mask level with the interrupt priority level (IPL) <strong>of</strong> the interrupt and allowing ordisallowing the interrupt. Therefore, if the interrupt mask is changed after an interrupt isarbitrated and accepted as pending but before the interrupt is executed, the interrupt willbe executed, regardless <strong>of</strong> what the mask was changed to. The following examples showthat the old interrupt mask is in effect for up to four additional instruction cycles after theinterrupt mask is changed. All instructions shown in the examples here are one-word instructions;however, one two-word instruction can replace two one-word instructionsexcept where noted.1. Program flow with no interrupts after interrupts are disabled:-ORI #03,MRINST 1INST2INST3INST4;Disable interrupts2. The four possible variations in program flow that may occur after interrupts aredisabled:ORI #03,MR ORI #03,MR ORI #03,MR ORI #03,MRII (See Note 2) INST 1 INST1 INST 111+1 II INST2 INST2INST 1 11+1 II INST3 (See Note 1)INST2 INST2 11+ 1 IIINST3 INST3 INST3 11+1INST4 INST4 INST4 INST4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!