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:
I'm using interrupts to read the pins:
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:
All the other digital inputs within the same program are being read correctly.
Could anyone suggest what the issue might be?
Thanks in advance!
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
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.
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
Hi,
The part number is RT1176AVM8A
thank you,