InterruptUNIT
13
로봇 SW 교육원조용수
2학습 목표
• Interrupt • Pending & Clear• Interrupt Vector• NVIC
3Interrupt
• 마이크로 프로세서 실행 중 , 외부 장치나 예외 상황이 발생하여 처리가 필요할 경우 , 마이크로 프로세서에게 처리를 요청하는 수단 .
• 마이크로 프로세서는 인터럽트가 발생하면 , 실행중인 작업을 중단하고 , 인터럽트 처리를 위한 서비스 루틴을 실행한다 .
4Pending & Clear
• Interrupt 가 발생하면 Interrupt Controller 는 어떠한 인터럽트가 발생하였는지를 알리기 위하여 status Register 의 Pending Bit 를 Set 하게 된다 .
• Interrupt Controller 는 Pending Bit 를 참고하여 Interrupt Service 루틴을 선택하여 실행한다 .
• Interrupt Service 루틴에서는 해당 Interrupt 를 처리하였다는 것을 확인하기 위하여 Clear Pend-ing 작업을 해야 한다 .
5NVIC
• Nested Vectored Interrupt Controller• 32 Interrupt and 4 Level Priority• Automatic Processor State Saving and Restoration• Reduce Interrupt latency
– When an interrupt is accepted, – the starting address of the interrupt service routine (ISR) is fetched
from a vector table in memory. – NVIC will also automatically save processor state including the reg-
isters “PC, PSR, LR, R0~R3, R12” to the stack. – Execute Interrupt Service Routine – At the end of the ISR, the NVIC will restore the mentioned registers
from stack and resume the normal execution.
6Interrupt Vector
• System Interrupt Vector– ARM Core 가 처리하는 Interrupt – 15 개의 Vector 가 할당
7Interrupt Vector
• External Interrupt Vector– 코어 외부의 Interrupt
Controller(NVIC) Vector – 32 개의 Vector 가 할당
8Interrupt Control Register
9Interrupt Control Register
10Interrupt Control Register
11Interrupt Control Register
12Interrupt Control Register
13Interrupt Control Register
14Interrupt Control Register
15Interrupt Control Register
16Interrupt Control Register
17Interrupt Control Register
18Interrupt Control Register