The reading of the digital input on GPIO_SNVS_05 is not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The reading of the digital input on GPIO_SNVS_05 is not working

448 Views
sajithdevidas
Contributor III

Hi,

I'm using an RT1170 board with MCUXpresso, and I need to read a digital input pin that I have configured on GPIO_SNVS_05.

Here is my configuration:

sajithdevidas_0-1704723131549.png

I'm using interrupts to read the pins:

EnableIRQ(GPIO13_Combined_0_31_IRQn);
 
And this is my ISR:
 

void DISCRETE_INPUT_ISR_GPIO13(void)

{
// Clearing all the interrupt flags
GPIO_PortClearInterruptFlags(GPIO_PORT_13, (1<<DIN_1_PIN) | (1<<DIN_2_PIN) |
(1<<DIN_3_PIN) | (1<<DIN_4_PIN) | (1<<DIN_5_PIN) |
(1<<DIN_6_PIN) | (1<<DIN_7_PIN) | (1<<DIN_8_PIN) |
(1<<DIN_9_PIN) | (1<<DIN_10_PIN));

// Read the GPIO states
DIN_1 = GPIO_PinRead(GPIO_PORT_13, DIN_1_PIN);
DIN_2 = GPIO_PinRead(GPIO_PORT_13, DIN_2_PIN);
DIN_3 = GPIO_PinRead(GPIO_PORT_13, DIN_3_PIN);
DIN_4 = GPIO_PinRead(GPIO_PORT_13, DIN_4_PIN);
DIN_5 = GPIO_PinRead(GPIO_PORT_13, DIN_5_PIN);
DIN_6 = GPIO_PinRead(GPIO_PORT_13, DIN_6_PIN);
DIN_7 = GPIO_PinRead(GPIO_PORT_13, DIN_7_PIN);
DIN_8 = GPIO_PinRead(GPIO_PORT_13, DIN_8_PIN);
DIN_9 = GPIO_PinRead(GPIO_PORT_13, DIN_9_PIN);
DIN_10 = GPIO_PinRead(GPIO_PORT_13, DIN_10_PIN);

SDK_ISR_EXIT_BARRIER;

}

 

However, while I'm trying to read the pin using GPIO_PinRead(), it's showing the following error:

sajithdevidas_1-1704723270261.png

 

All the other digital inputs within the same program are being read correctly.

Could anyone suggest what the issue might be?

Thanks in advance!

 

0 Kudos
4 Replies

266 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Please Enable the Software Input On at the pin configuration.
Additionally, make sure that the PinRead is outside the IRQ handler, it is suggested to keep them as short as possible.

Best regards,
Omar

0 Kudos

255 Views
sajithdevidas
Contributor III

Yeah, I did the same, but the issue persists. In debug mode, when I'm giving input to that pin, the error scenario occurs and the debug mode automatically closes. However, other than in debug mode, the functionality works fine.

0 Kudos

388 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello

What is the specific part number of your device? There are issues using those pads when the specific part supports tamper. The result obtained suggests that the tamper causes this as it disconnects the debug session when triggered.

More details about this tamper are on Solved: How to config GPIO to wake pin in RT1170 - NXP Community

 

Best regards,
Omar

0 Kudos

359 Views
sajithdevidas
Contributor III

Hi,

The part number is RT1176AVM8A

thank you,

 

0 Kudos