STM8S有5组IO端口,每组端口分别有若干引脚可以作为外部中断触发输入,分别为:
端口A: PA[6:2];端口B: PB[7:0];端口C: PC[7:0];端口D: PD[6:0];端口E: PE[7:0]。
External interrupts
Five interrupt vectors are dedicated to external Interrupt events:
● 5 lines on Port A: PA[6:2]
● 8 lines on Port B: PB[7:0]
● 8 lines on Port C: PC[7:0]
● 7 lines on Port D: PD[6:0]
● 8 lines on Port E: PE[7:0]
PD(7) is the Top Level Interrupt source (TLI).
To generate an interrupt, the corresponding GPIO port must be configured in input mode
with interrupts enabled. Refer to the register description in the GPIO chapter for details.
When an external interrupt occurs, the corresponding bit is set in the EXTI_SRx status
register. This indicates a pending interrupt. Clearing this bit, writing a 1 in it, clears the
corresponding pending external interrupt.
The interrupt sensitivity must be configured in the external interrupt control register 1
(EXTI_CR1) and external interrupt control register 2 (EXTI_CR2)。
用户952492 2011-7-19 14:31