
BK
TP.HCM
2009
dce
©2009, CE Department
Ngắt quãng
©2009, CE Department

2009
dce
©2009, CE Department 2
Giới thiệu
• Ngắt quãng là gì?
–An interrupt is the occurrence of a condition--
an event -- that cause a temporary suspension
of a program while the event is serviced by
another program (Interrupt Service Routine
ISR or Interrupt Handler).
©2009, CE Department

2009
dce
©2009, CE Department 3
©2009, CE Department
Giới thiệu (tt)
• 18F2220 có nhiều nguồn ngắt và có độ ưu
tiên (priority) khác nhau.
– Ngắt có độ ưu tiên cao : 0008h
– Ngắt có độ ưu tiên thấp : 0018h
Khi một nguồn ngắt có độ ưu tiên cao xảy ra thì nó ngắt bất
kì nguồn ngắt có độ ưu tiên thấp, dù cho nguồn ngắt đó đang
thực hiện

2009
dce
©2009, CE Department 4
Giới thiệu (tt)
©2009, CE Department

2009
dce
©2009, CE Department 5
Các loại ngắt quãng
• Ngắt ngoài (3 kênh).
• Timer 0, 1, 2.
• PortB interrupt change.
• Capture/Compare/PWM interrupt
• USART
• ADC
• Comparator
©2009, CE Department