AnsweredAssumed Answered

Toggling a Port Pin on MK20DN64

Question asked by Ryan Pearson on Apr 5, 2019
Latest reply on Apr 8, 2019 by Robin_Shen

I made a KDS project for the MK20DN64 using Processor Expert.  I'm simply trying to configure PTD4/LLWU_P14 as a GPIO and toggle the pin.  I am able to debug the project, but I do not see the pin being driven.  The pin just floats.  What is missing?  I'm using GPIO_PDD_SetPortOutputDirectionMask and GPIO_PDD_SetPortDataOutput.  Here is my main function:


int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
/* Write your local variable definition here */
long int test;
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
/*** End of Processor Expert internal initialization. ***/

/* Write your code here */
/* For example: for(;;) { } */
GPIO_PDD_SetPortOutputDirectionMask((GPIO_MemMapPtr)0x4004C000u, 0x4000);
GPIO_PDD_SetPortDataOutput((GPIO_MemMapPtr)0x4004C000u, 0x4000);
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/