NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Avoiding Double Interrupts with the GPIO Peripheral

From Texas Instruments Wiki
Jump to: navigation, search

Summary[edit]

When using GPIO interrupts on certain devices it is possible to get interrupted twice due to one interrupt event. This only happens when both the direct interrupt and the bank interrupt are simultaneously enabled. Generally speaking this issue just causes unnecessary interrupt overhead, but depending on how the ISRs are implemented this could potentially cause troubles in the application.

This article is applicable to most newer devices with 64x+ cores in the c6000/Davinci family.

Devices affected (as of May 14, 2009):

  • DM355
  • DM644x
  • DM646x
  • C642x
  • DM643x

Devices NOT affected (as of May 14, 2009):

  • OMAP3530 (different GPIO peripheral)
  • C674x (bank interrupts only)
  • OMAP-L13x (bank interrupts only)
  • C641x (different GPIO peripheral)

This scenario can easily be avoided. For a given bank of 16 interrupts it's recommended to use ONLY direct interrupts or ONLY the bank interrupt, but not both.

Example[edit]

Let's take DM355 as an example. Bank0 contains GPIO[15:0]. Let's say we need interrupts from 3 of them, GPIO[2:0].

The ARM Subsystem User's Guide has a table called "AINTC Interrupt Connections" that shows how the peripherals have been connected to the ARM's interrupt controller for that device. In the case of DM355 there are direct interrupts for GPIO0-9 connected to interrupts 44-53 of the controller. The GPIO bank interrupts 0-6 connected to interrupts 54-60.

Setup resulting in double interrupts[edit]

Let's say that we use the GPIO0 direct interrupt (#44) to get interrupts that occur on GPIO0, and let's say that we attempt to use bank0 interrupt (#54) to detect GPIO1-2 interrupts. The problem we will encounter is that the GPIO0 interrupt will trigger interrupt #44 and interrupt #54. So in this scenario GPIO1-2 will trigger only #54 but GPIO0 will trigger both #44 and #54.

Setups resulting in one interrupt[edit]

Instead we could have used interrupt #44-46 as "direct" interrupts for GPIO0-2. Had we configured things in this way then each GPIO would generate only one interrupt on its corresponding interrupt line.

Alternatively we could have used interrupt #54 to handle all 3 GPIOs and that situation would also avoid two interrupts for a single event.

Diagrams of GPIO Interrupts[edit]

Avoiding Double Interrupts2.jpg

Avoiding Double Interrupts1.jpg

Avoiding the issue[edit]

Ultimately to avoid this issue you need to make sure that you don't use direct interrupts and the bank interrupt for a given bank of interrupts. That will prevent 2 interrupts from occurring due to a given event.

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Avoiding Double Interrupts with the GPIO Peripheral here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Avoiding Double Interrupts with the GPIO Peripheral here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Avoiding Double Interrupts with the GPIO Peripheral here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Avoiding Double Interrupts with the GPIO Peripheral here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Avoiding Double Interrupts with the GPIO Peripheral here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Avoiding Double Interrupts with the GPIO Peripheral here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Avoiding Double Interrupts with the GPIO Peripheral here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Avoiding Double Interrupts with the GPIO Peripheral here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Avoiding Double Interrupts with the GPIO Peripheral here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity