| 数据搜索系统,热门电子元器件搜索 |
|
ADE7978 数据表(PDF) 76 Page - Analog Devices |
|
|
|||||||||||||||||||||||||||||
ADE7978 数据表(HTML) 76 Page - Analog Devices |
|
76 / 120 page ![]() ADE7978/ADE7933/ADE7932 Data Sheet Rev. 0 | Page 76 of 120 USING THE INTERRUPTS WITH AN MCU Figure 93 shows a timing diagram for a suggested implemen- tation of ADE7978 interrupt management using an MCU. At Time t1, the IRQx pin goes low, indicating that one or more interrupt events have occurred in the ADE7978. After the IRQx pin goes low, the following steps take place: 1. Tie the IRQx pin to a negative edge triggered external interrupt on the MCU. 2. Configure the MCU to start executing its interrupt service routine (ISR) when it detects the negative edge. 3. When the MCU starts executing the ISR, disable all interrupts using the global interrupt mask bit. The MCU external interrupt flag can now be cleared to capture interrupt events that occur during the current ISR. 4. When the MCU interrupt flag is cleared, read STATUSx, the interrupt status register. The interrupt status register contents are used to determine the source of the interrupts and, therefore, the appropriate action to take. 5. Write back the same STATUSx contents to the ADE7978 to clear the status flags and reset the IRQx line to logic high (t2). If a subsequent interrupt event occurs during the ISR (t3), that event is indicated by the MCU external interrupt flag being set again. On returning from the ISR, the global interrupt mask bit is cleared in the same instruction cycle, and the external interrupt flag uses the MCU to jump to its ISR again. This action ensures that the MCU does not miss any external interrupts. Figure 94 shows a recommended timing diagram when the status bits in the STATUSx registers work in conjunction with bits in other registers. When the IRQx pin goes low, the STATUSx register is read, and if one of these bits is set to 1, a second status register is read immediately to identify the phase that triggered the interrupt. In Figure 94, PHx denotes the PHNOLOAD, PHSTATUS, IPEAK, VPEAK, or PHSIGN register. After reading the PHx register, the STATUSx register is written back to clear the status flags. JUMP TO ISR GLOBAL INTERRUPT MASK CLEAR MCU INTERRUPT FLAG READ STATUSx JUMP TO ISR WRITE BACK STATUSx ISR ACTION (BASED ON STATUSx CONTENTS) ISR RETURN GLOBAL INTERRUPT MASK RESET MCU INTERRUPT FLAG SET PROGRAM SEQUENCE t2 t1 t3 IRQx Figure 93. Interrupt Management PROGRAM SEQUENCE IRQx JUMP TO ISR GLOBAL INTERRUPT MASK CLEAR MCU INTERRUPT FLAG READ STATUSx READ PHx JUMP TO ISR WRITE BACK STATUSx ISR ACTION (BASED ON STATUSx CONTENTS) ISR RETURN GLOBAL INTERRUPT MASK RESET MCU INTERRUPT FLAG SET t2 t1 t3 Figure 94. Interrupt Management When PHSTATUS, IPEAK, VPEAK, or PHSIGN Register Is Involved |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |