Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
162
Добавлен:
01.03.2016
Размер:
3.56 Mб
Скачать

Interrupt controller (ITC)

RM0016

 

 

6.2.1Servicing pending interrupts

Several interrupts can be pending at the same time. The interrupt to be taken into account is determined by the following two-step process:

1.The highest software priority interrupt is serviced.

2.If several interrupts have the same software priority then the interrupt with the highest hardware priority is serviced first.

When an interrupt request is not serviced immediately, it is latched and then processed when its software priority combined with the hardware priority becomes the highest one.

Note: 1 The hardware priority is exclusive while the software one is not. This allows the previous process to succeed with only one interrupt.

2RESET, TLI and TRAP are considered as having the highest software priority in the decision process.

See Figure 14 for a description of pending interrupt servicing process.

Figure 14. Priority decision process

 

PENDING

 

INTERRUPTS

Same

Different

 

PRIORITY

 

HIGHEST SOFTWARE

 

PRIORITY SERVICED

HIGHEST HARDWARE

 

PRIORITY SERVICED

 

6.2.2Interrupt sources

Two interrupt source types are managed by the STM8 interrupt controller:

Non-maskable interrupts: RESET, TLI and TRAP

Maskable interrupts: external interrupts or interrupts issued by internal peripherals

Non-maskable interrupt sources

Non-maskable interrupt sources are processed regardless of the state of bits I1 and I0 of the CCR register (see Figure 13). PC, X, Y, A and CCR registers are stacked only when a

60/454

Doc ID 14587 Rev 9

RM0016

Interrupt controller (ITC)

 

 

TRAP interrupt occurs. The corresponding vector is then loaded in the PC register and bits I1 and I0 of the CCR register are set to disable interrupts (level 3).

TRAP (non-maskable software interrupt)

This software interrupt source is serviced when the TRAP instruction is executed. It is serviced as a TLI according to the flowchart shown in Figure 13.

A TRAP interrupt does not allow the processor to exit from Halt mode.

RESET

The RESET interrupt source has the highest STM8 software and hardware priorities. This means that all the interrupts are disabled at the beginning of the reset routine. They must be re-enabled by the RIM instruction (see Table 11: Dedicated interrupt instruction set).

A RESET interrupt allows the processor to exit from Halt mode.

See RESET chapter for more details on RESET interrupt management.

TLI (top level hardware interrupt)

This hardware interrupt occurs when a specific edge is detected on the corresponding TLI input.

Caution: A TRAP instruction must not be used in a TLI service routine.

Doc ID 14587 Rev 9

61/454

Соседние файлы в папке Минимум документации STM8_1