KV10 PTC6 & PTC7

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KV10 PTC6 & PTC7

Jump to solution
702 Views
stephenmonn
Contributor I


I'm having a problem running PTC6 and PTC7 as GPIO. The microcontroller is an MKV10Z16VLC7.

 

First I initialize the pin for GPIO

 

 

PORT_HAL_SetMuxMode(PORTC, 7UL, kPortMuxAsGpio);

gpio_output_pin_user_config_t CLK = {

  .pinName = GPIO_MAKE_PIN(GPIOC_IDX, 7U),

  .config.outputLogic = 0,

  .config.slewRate = kPortFastSlewRate,

  .config.driveStrength = kPortLowDriveStrength,

};

GPIO_DRV_OutputPinInit(&CLK);

 

Then I try toggling the pin manually

 

 

  GPIO_WR_PSOR(GPIOC, 1U << 7U);

  GPIO_WR_PCOR(GPIOC, 1U << 7U);

 

But this does not work. The pin stays low. And if I try to pull the whole port high, all the pins go high except PTC6 and PTC7.

 

 

  GPIO_WR_PDOR(GPIOC, 0xFF);

 

From the datasheet I can see that these two pins are CMP0_INx by default. Is there some sort of internal pull down that I need disable? The pins aren't connected to anything on the PCB either.

Labels (1)
0 Kudos
1 Solution
562 Views
jozefcicka-b508
NXP Employee
NXP Employee

Hi Stephen, PTC6 and PTC7 are true open drain pins. These pins cannot drive a logic one without a pull-up resistor. If you want use these pins as GPIO then you must have external pull-up resistor.

View solution in original post

0 Kudos
1 Reply
563 Views
jozefcicka-b508
NXP Employee
NXP Employee

Hi Stephen, PTC6 and PTC7 are true open drain pins. These pins cannot drive a logic one without a pull-up resistor. If you want use these pins as GPIO then you must have external pull-up resistor.

0 Kudos