STM32F7 11 Extended interrupts and events controller (EXTI)

Started by tha, November 08, 2022, 09:58:57 AM

Previous topic - Next topic

tha

11 Extended interrupts and events controller (EXTI)

The external interrupt/event controller ประกอบด้วยมากถึง 24 edge detectors สำหรับการสร้าง event/interrupt requests. แต่ละ input line สามารถถูกกำหนดค่าเพื่อเลือก the type (interrupt or event) ได้อย่างเป็นอิสระและ the corresponding trigger event (rising or falling หรือทั้งคู่). แต่ละ line สามารถถูกบังได้อย่างอิสระอีกด้วย. A pending register จะรักษา the status line ของ the interrupt requests.

tha

11.1 EXTI main features

คุณลักษณะหลักของ the EXTI controller เป็นดังต่อไปนี้:
•   การทริกและการบังอย่างเป็นอิสระบนแต่ละ interrupt/event line
•   status bit ที่อุทิศให้สำหรับแต่ละ interrupt line
•   การสร้างได้มากถึง 24 software event/interrupt requests
•   การตรวจจับ external signals ที่มี a pulse width ต่ำกว่า the APB2 clock period. ดูที่ the electrical characteristics section
     of the STM32F75xxx and STM32F74xxx datasheets สำหรับรายละเอียดเกี่ยวกับ parameter นี้.

tha

11.2 EXTI block diagram

Figure 30 แสดง the block diagram.



tha

11.3 Wakeup event management

The STM32F75xxx and STM32F74xxx devices สามารถจัดการ external or internal events เพื่อว่าจะปลุก the core (WFE). The wakeup event สามารถถูกสร้างอย่างใดอย่างหนึ่งโดย:
•   การเปิดใช้งาน an interrupt ใน the peripheral control register แต่ไม่ใน the NVIC, และเปิดใช้งาน the SEVONPEND bit ใน
     the Cortex®-M7 System Control register. เมื่อ the MCU กลับคืนมาทำงานต่อจาก WFE, the peripheral interrupt
     pending bit และ the peripheral NVIC IRQ channel pending bit (ใน the NVIC interrupt clear pending register) ต้อง
     ถูกเคลียร์.
•   หรือกำหนดค่า an external or internal EXTI line ใน event mode. เมื่อ the CPU กลับคืนมาทำงานต่อจาก WFE, มันไม่จำเป็น
     ต้องเคลียร์ the peripheral interrupt pending bit or the NVIC IRQ channel pending bit เนื่องจาก the pending bit ที่ตรง
     กันกับ the event line ไม่ได้ถูกเซ็ต.

เพื่อใช้ an external line เป็น a wakeup event, ดูที่ Section 11.4: Functional description.

tha

11.4 Functional description

เพื่อสร้าง the interrupt, the interrupt line ควรถูกกำหนดค่าและเปิดใช้งาน. นี้สามารถทำโดยการโปรแกรม the two trigger registers ด้วย the desired edge detection(ขอบขาที่ต้องการตรวจจับ) และโดยการเปิดใช้งาน the interrupt request(การร้องขออินเตอรัพท์) โดยการเขียน '1' ไปยังบิตที่ตรงกันใน the interrupt mask register. เมื่อขอบขา(ขึ้นหรือลง)ที่เลือกเกิดขึ้นบน the external interrupt line, an interrupt request จะถูกสร้าง. The pending bit ที่ตรงกับ the interrupt line จะถูกเซตด้วย. interrupt request นี้จะถูกรีเซ็ตโดยการเขียน '1' ใน the pending register (ในบิตที่ตรงกัน).

เพื่อสร้าง the event, the event line ควรถูกกำหนดค่าและเปิดใช้งาน. นี้สามารถทำโดยการโปรแกรม the two trigger registers ด้วย the desired edge detection(ขอบขาที่ต้องการตรวจจับ) และโดยการเปิดใช้งาน the event request โดยการเขียน '1' ไปยังบิตที่ตรงกันใน the event mask register.  เมื่อขอบขา(ขึ้นหรือลง)ที่เลือกเกิดขึ้นบน the event line, an event pulse(พลัสเดียว) จะถูกสร้าง. The pending bit ที่ตรงกันกับ the event line ไม่ได้ถูกเซ็ต

An interrupt/event request สามารถถูกสร้างโดย software โดยการเขียน '1' ใน the software interrupt/event register

tha

11.5 Hardware interrupt selection

เพื่อกำหนดค่า a line เป็น interrupt sources, ใช้ขบวนการต่อไปนี้:
1.   กำหนดค่า the corresponding mask bit (EXTI_IMR)
2.   กำหนดค่า the Trigger selection bits ของ the interrupt lines (EXTI_RTSR and EXTI_FTSR)
3.   กำหนดค่า the enable and mask bits ที่ควบคุม the NVIC IRQ channel ที่แม็ปถึง the external interrupt controller (EXTI)
      ดังนั้น an interrupt ที่มาจากหนึ่งของ the 24 lines สามารถถูกรับรู้ได้อย่างถูกต้อง.

tha

11.6 Hardware event selection

เพื่อกำหนดค่า a line เป็น event sources, ใช้ขบวนการต่อไปนี้:
1.   กำหนดค่า the corresponding mask bit (EXTI_EMR)
2.   กำหนดค่า the Trigger selection bits of the event line (EXTI_RTSR and EXTI_FTSR)

tha

11.7 Software interrupt/event selection

The line สามารถถูกกำหนดค่าเป็น software interrupt/event line. ต่อไปนี้คือขบวนการที่จะสร้าง a software interrupt.
1.   กำหนดค่า the corresponding mask bit (EXTI_IMR, EXTI_EMR)
2.   เซ็ตบิตที่ต้องการใน the software interrupt register (EXTI_SWIER)