I use KL03 & need use ( SWD_CLK, SWD_DIO ,RESET_b) as an I/O ( PTA0,PTA1,PTA2)

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

I use KL03 & need use ( SWD_CLK, SWD_DIO ,RESET_b) as an I/O ( PTA0,PTA1,PTA2)

612 Views
tigerlo
Contributor III

I use KL03 & need use ( SWD_CLK, SWD_DIO ,RESET_b) as an I/O ( PTA0,PTA1,PTA2) , but as I use these function , 

PTA0 is ok, but PTA1 & PTA2 are fail, Ilist the I/O initial & config , please help me check are there something wrong ?

1. Config I/O
kGpioSpealerPWMCtrl  = GPIO_MAKE_PIN(GPIOA_IDX, 0),  /*  used as speaker PWM control */     -------------  Control PWN OK
kGpioTempIndicatorLED = GPIO_MAKE_PIN(GPIOA_IDX, 1),  /* used as  Temp LED control */          ------------  Control LED  FAIL, no response
kGpioDoorLockCtrl  = GPIO_MAKE_PIN(GPIOA_IDX, 2),  /* used as door open control */   -------------- Control  I/O FAIL , cause system system reset
2. Config I/O
PORT_HAL_SetMuxMode(PORTA,1u,kPortMuxAsGpio); // Temp Indicator  
PORT_HAL_SetMuxMode(PORTA,2u,kPortMuxAsGpio); // Lock control
3. I/O control
GPIO_DRV_SetPinOutput(kGpioTempIndicatorLED); //turn on   kGpioTempIndicatorLED
GPIO_DRV_ClearPinOutput(kGpioTempIndicatorLED); //turn off   kGpioTempIndicatorLED
GPIO_DRV_SetPinOutput(kGpioDoorLockCtrl); //turn on
GPIO_DRV_ClearPinOutput(kGpioDoorLockCtrl); //turn off
Tiger

Labels (1)
0 Kudos
Reply
2 Replies

531 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Tiger,

1. To set a pin as output, there are 3 steps. a) set pin mux; b) set this port as output; c) set pin value.

So, before GPIO_DRV_SetPinOutput(), there should be a GPIO_DRV_SetPinDir().

2. /Reset pin is a special pin. You should disable it by programming FTFA_FOPT[RESET_PIN_CFG].

Regards,

Jing

0 Kudos
Reply

531 Views
tigerlo
Contributor III

Jing,

    Thanks for help, I solved this issue.

Tiger

0 Kudos
Reply