Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8xC196EA microcontroller user's manual.1998.pdf
Скачиваний:
52
Добавлен:
23.08.2013
Размер:
8.29 Mб
Скачать

8XC196EA USER’S MANUAL

is four state times plus remaining instruction fetch time and the execution time of the next instruction.

When a standard interrupt request is acknowledged, the hardware clears the interrupt pending bit and forces a call to the address contained in the corresponding interrupt vector. When a PTS interrupt request is acknowledged, the hardware immediately vectors to the PTSCB and begins executing the PTS routine.

6.4.1Situations that Increase Interrupt Latency

If an interrupt request occurs while any of the following instructions are executing, the interrupt will not be acknowledged until after the next instruction is executed:

the signed prefix opcode (FE) for the two-byte, signed multiply and divide instructions

a protected instruction: DI, EI, DPTS, EPTS, POPA, POPF, PUSHA, PUSHF (see Appendix A for descriptions of these instructions)

a read-modify-write instruction: AND, ANDB, OR, ORB, XOR, XORB

the unimplemented opcode interrupt and the software trap interrupt

Each PTS cycle within a PTS routine cannot be interrupted. A PTS cycle is the entire PTS response to a single interrupt request. In block transfer mode, a PTS cycle consists of the transfer of an entire block of bytes or words. This means a worst-case latency of 500 states if you assume a block transfer of 32 words from one external memory location to another. See Table 6-6 on page 6-18 for PTS cycle execution times.

6.4.2Calculating Latency

The maximum latency occurs when the interrupt request occurs too late (four states before the current instruction finishes executing) for acknowledgment following the current instruction. The following worst-case calculation assumes that the current instruction is not a protected instruction To calculate latency, add the following terms:

Time for the interrupt request to be detected (4 state times).

One state each to clock edge, synchronize the interrupt, prioritize the interrupt request, and request interrupt service.

Time for the current instruction to finish execution (4 state times).

If this is a protected instruction, the instruction that follows it must also execute before the interrupt can be acknowledged. Add the execution time of the instruction that follows a protected instruction.

Time for the next instruction to execute. (See Appendix A for instruction execution times.)

The longest instruction, NORML, takes 39 state times. However, the BMOV instruction could actually take longer if it is transferring a large block of data. If your code contains routines that transfer large blocks of data, you may get a more accurate worst-case value if you use the BMOV execution time in your calculation instead of NORML.

6-16

STANDARD AND PTS INTERRUPTS

For standard interrupts only, the response time to get the vector, force the call, and fetch the first instruction of the service routine.

in 64-Kbyte mode, 11 state times for an internal stack or 13 for an external (outside register RAM) stack, assuming a zero-wait-state bus.

in 2-Mbyte mode, 15 state times for an internal stack or 18 for an external (outside register RAM) stack, assuming a zero-wait-state bus.

6.4.2.1Worst-case Interrupt Latency

Figure 6-6 illustrates worst-case interrupt latency. In 64-Kbyte mode, the worst-case delay for an interrupt is 56 state times (4 + 39 + 11 + 2) if the stack is in external memory. In 2-Mbyte mode, the worst-case delay increases to 61 state times (4 + 39 + 15 + 3). This delay time does not include the time needed to execute the first instruction in the interrupt service routine or to execute the instruction following a protected instruction.

2-Mbyte Mode

64-Kbyte Mode

4

3

2 1

39

15

3

12

6

4

3

2 1

39

11

2

12

6

Execution

 

 

Ending

"NORML"

End

 

Call is

If Stack

"PUSHA"

If Stack

 

 

Instruction

"NORML"

 

Forced

External

External

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Interrupt Routine

Interrupt

 

 

 

 

 

 

 

 

 

 

 

 

 

Interrupt

 

 

Set

 

Cleared

 

 

 

 

 

 

Pending

 

 

 

 

 

 

 

 

 

Bit

 

 

2-Mbyte Mode — 61 State Times

 

 

 

 

 

 

 

Response

 

 

 

 

 

 

 

 

 

Time

 

 

64-Kbyte Mode — 56 State Times

 

 

 

 

 

 

 

A3395-01

Figure 6-6. Worst-case Interrupt Response Time

6.4.2.2PTS Interrupt Latency

In both 64-Kbyte and 2-Mbyte modes, the maximum delay for a PTS interrupt is 43 state times (4 + 39) as shown in Figure 6-7. This delay time does not include the added delay if a protected instruction is being executed or if a PTS request is already in progress. See Table 6-6 for execution times for PTS cycles.

6-17

Соседние файлы в предмете Электротехника