Hello !
I need to have ISR by multiple GPIO lines in ACTIVE, SLEEP and POWER DOWN modes.
I would like to detect both edges and try to utilize both GINTx and include pin twice and configure GINT0 for detect rising edge and GINT1 for falling edge ( or vise versa).
Looks like scheme works if one pin is taken from GPIO0 port. But If I add pins from GPIO1 port, only falling edge works.
I have checked all possible combinations and haven't find working combination how-to detect both edges for set of pins from both GPIO ports.
Is any limitations exists ? There are not visible in UM.
I have attached exact modified gint example.
Essential part :
/* Select one input, active low for GINT0 */
#define DEMO_GINT0_POL_MASK_LOW ~(1U << BOARD_SW1_GPIO_PIN)
#define DEMO_GINT0_POL_MASK_HIGH (1U << BOARD_SW1_GPIO_PIN)
#define DEMO_GINT0_ENA_MASK (1U << BOARD_SW1_GPIO_PIN)
/* Select two inputs, active low for GINT1. SW2 & SW3 must be connected to the same port */
#define DEMO_GINT1_POL_MASK_LOW ~((1U << BOARD_SW2_GPIO_PIN) | (1U << BOARD_SW3_GPIO_PIN))
#define DEMO_GINT1_POL_MASK_HIGH ((1U << BOARD_SW2_GPIO_PIN) | (1U << BOARD_SW3_GPIO_PIN))
#define DEMO_GINT1_ENA_MASK ((1U << BOARD_SW2_GPIO_PIN) | (1U << BOARD_SW3_GPIO_PIN))
....
/* Initialize GINT0 & GINT1 */
GINT_Init(GINT0);
GINT_Init(GINT1);
/* Setup GINT0 for edge trigger, "OR" mode */
GINT_SetCtrl(GINT0, kGINT_CombineOr, kGINT_TrigEdge, gint0_callback);
/* Setup GINT1 for edge trigger, "OR" mode */
GINT_SetCtrl(GINT1, kGINT_CombineOr, kGINT_TrigEdge, gint1_callback);
/* Select pins & polarity for GINT0 */
//GINT_ConfigPins(GINT0, DEMO_GINT0_PORT, DEMO_GINT0_POL_MASK_LOW, DEMO_GINT0_ENA_MASK); // GPIO0, pin 5, SW1
//GINT_ConfigPins(GINT0, DEMO_GINT0_PORT, DEMO_GINT0_POL_MASK_HIGH, DEMO_GINT0_ENA_MASK); // GPIO0, pin 5, SW1
GINT_ConfigPins(GINT0, DEMO_GINT1_PORT, DEMO_GINT1_POL_MASK_HIGH, DEMO_GINT1_ENA_MASK); //
//GINT_ConfigPins(GINT0, DEMO_GINT1_PORT, DEMO_GINT1_POL_MASK_LOW, DEMO_GINT1_ENA_MASK);
/* Select pins & polarity for GINT1 */
//GINT_ConfigPins(GINT1, DEMO_GINT0_PORT, DEMO_GINT0_POL_MASK_HIGH, DEMO_GINT0_ENA_MASK); // GPIO0, pin 5, SW1
//GINT_ConfigPins(GINT1, DEMO_GINT0_PORT, DEMO_GINT0_POL_MASK_LOW, DEMO_GINT0_ENA_MASK); // GPIO0, pin 5, SW1
GINT_ConfigPins(GINT1, DEMO_GINT1_PORT, DEMO_GINT1_POL_MASK_LOW, DEMO_GINT1_ENA_MASK); // Port1, pins 9, 18
//GINT_ConfigPins(GINT1, DEMO_GINT1_PORT, DEMO_GINT1_POL_MASK_HIGH, DEMO_GINT1_ENA_MASK); // Port1, pins 9, 18
/* Enable callbacks for GINT0 & GINT1 */
GINT_EnableCallback(GINT0);
GINT_EnableCallback(GINT1);
Could you suggest how-to allocate multiple pins from GPIO1 port for be able to detect rising and falling edges
?
Regards,
Eugene
Hello !
One more addition. It looks like depends from how many pins is added to both GINTx.
If one pin added to both GINTx, both edges are detected. If more than 1, it start to detect falling edge only.
Weird. May be it depends from some configuration what should be used when power management API is called ?
Regards,
Eugene
I'm currently testing this to see if I can achieve the behavior you are expecting.
Also from your other post regarding the revisions. Please work with the latest revision you have, as the earlier revisions will not work as well with the new MCUXpresso version or SDK.
I will let you know as soon as [possible, my results.
Best Regards,
Sabina
Hi Sabina !
I'm using latest version of everything : board A2,SDK and MCUExpresso11.0.1+Debug patches.
Regards,
Eugene
Hi Eugene,
Thanks for the update. You can follow the continuation of the topic on your other post.
https://community.nxp.com/thread/517911
Best Regards,
Sabina