There are two possible ways an GPIO interrupt can be routed:
1. Fixed function route
2. DSI route
To use the fixed function route, you to need use the dedicated port interrupt check box (in the input tab of the pins component). The fixed function route has a Edge detect circuit that can detect both the rising and falling. But this will generate only one interrupt per port. To find out which pin caused the interrupt, you need to use the return value of Pin_ClearInterrupt(). This will return you the exact pin that caused the interrupt.
Note: Usually the fixed function route is always level triggered. But the GPIO has additional circuitry that includes a Edge detect circuit.
When you use the DSI route (the one you have used), there are two ways:
1. Bypass the Edge trigger block via DSI - So only level trigger
2. Through the “GPIO Edge Detect” block and to the interrupt source multiplexer via DSI
Note: The 2nd option only has rising edge option. That is why you were only able to detect the rising edges.
Therefore to detect both the edges:
1. You need to check the dedicated port interrupt check box
2. Select the interrupt types as both edges
3. Connect the ISR component to this dedicated path
4. Choose derived option in the interrupt type
We have added the schematic image of the DSI path and Fixed function path below:
Please let us know in case you need further clarifications.
So what does it mean when the Interrupt dropdown is set to "Both" and the "Dedicated interrupt" checkbox is unchecked?
When the DSI channel is selected, it can have only level or rising edge interrupt. (ie) when the Interrupt drop down is set to "Both" and the "Dedicated interrupt" checkbox is unchecked, it configures as only rising edge since the route has only rising edge detect circuit, it can't detect falling edges.
Please let us know in case of further clarifications.
So the configuration page incorrectly allows the user to select "both" when it is not, in fact both? Sounds like the dropdown should be disabled and set to "rising" any time the "dedicated" checkbox is unchecked?
There is one more way to generate port interrupts (Fixed function interrupts with trigger on both edges) using the Combined port interrupt option in the Global Signal Reference.
To do this, follow these steps:
1. Set the interrupt type in the Input tab of pins component.
Note: Dedicated interrupt is not checked
2. Choose combined port interrupt option in the Global signal name in Global signal component. This will trigger whenever any pin or port triggers an interrupt.
3. Connect an ISR component to the global signal component and configure the type as derived.
This settings will lead to a dedicated port interrupt that can generate interrupts on both edges of the signal.
Note: PSoC 4 Combined port interrupt signal will trigger an interrupt whenever there is a trigger in any pin of any port. We need to find the exact pin that caused the interrupt in the interrupt handler.
We kindly request you to refer the I/o subsystems chapter - Interuppt sections and the interrupts chapter in the device architecture TRM for your reference.
Please let us know if you have any further clarifications.