Article How do I use P0.1 as a GPIO instead of SWD on the MAX32660?

Since P0.1 is one of the SWD pins, you have to disable SWD for that pin to be used as GPIO.  Set bit 14 of the GCR_SCON register to disable SWD.  Example code:

// Wait a bit before turning off SWD.  This makes debugging a little easier.
TMR_Delay(MXC_TMR0, 500000, 0);
   
// Disable SWD.
MXC_GCR->scon |= (1 << 14);
   
// Configure P0.1 in GPIO mode.
gpio_cfg_t gpio = {PORT_0, PIN_1, GPIO_FUNC_OUT, GPIO_PAD_NONE};
GPIO_Config(&gpio);
 
// Toggle P0.1
while(1) {
    GPIO_OutSet(&gpio);
    GPIO_OutClr(&gpio);
}
 

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.