I am using lpc824 (lpc824M201JDH20J) controller on my custom board and I am trying to set the PO_2 (SWDIO) as GPIO output and P0_3 (SWCLK) as GPIO input pins. My board is powered with 2.8V supply with 47K pullup on the RESET. I have disabled the default function of SWDIO and SWCLK using the switch matrix. I have three leds connected to output pins (P0_1, P0_8 and P0_9). On startup, just after configuring these pins and making P0_2 High, in my while loop i am reading the status of the input pin (P0_3) and toggling the leds.
The problem is when I make PO_2 high and if i reset the controller 2 or 3 times my other pins are not getting configured properly. Like LEDs (P0_8 and P0_9) not going high and low and my input P0_3 is always reading low. but LED P0_1 is working. This issue happens only when i configure P0_2 as output and high and do reset few times. The code is working as expected if my P0_2 is output and low. I am attaching my code where if PO_2 is made high this problem occurs and if P0_2 is low everything works. Is there any problem with the P0_2 (SWDIO) making output and high? Why on several reset the pins are not getting configured properly? Any suggestion would be helpful.