AnsweredAssumed Answered

GPIO Outputs

Question asked by Sean McCartan on May 23, 2020
Latest reply on May 24, 2020 by Sean McCartan

Micro: MKV10Z32VLF7

IDE: MCUXpresso


I am trying to configure two pins on this micro to be digital outputs: PTC6 (pin 39) & PTC7 (pin 40). Code as follows:


gpio_pin_config_t PortC6 = {kGPIO_DigitalOutput,1};            // LED0, startup as HI

gpio_pin_config_t PortC7 = {kGPIO_DigitalOutput,1};            // LED1, startup as HI




void BOARD_InitPins(void)


    PORT_SetPinMux(PORTC, 6U, kPORT_MuxAsGpio);

    PORT_SetPinMux(PORTC, 7U, kPORT_MuxAsGpio);






After running the above code, neither of the pins are high.


I read back the following registers:

GPIOC_PDIR: 0x0 - Incorrect, read only register, should be 0xC0

GPIOC_PDDR: 0xC0 - Correct (both pins assigned as outputs)

GPIOC_PDOR: 0xC0 - Correct (both pins assigned level '1')


A value of "0" in the "GPIOC_PDIR" register indicating:"0 Pin logic level is logic 0, or is not configured for use by digital function."


What this is telling me is that I cannot assign these two pins as digital logic. Surely this is not correct? What am I missing here?