KV31F's PTB18 pin as GPIO input pin.

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

KV31F's PTB18 pin as GPIO input pin.

1,016 Views
trialaccount12
Contributor V

We are facing issue in configuring a gpio pin in KV31f board as input pin through MCU expresso. Can you please provide us any documentation or steps?I could not find any such. 

we could see documentations only for switches as input but not Pins as input.

Tags (2)
3 Replies

795 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Niranjan ravi ,

Search the PTB18 pin, then configure it to GPIO function :

pastedImage_1.png

then  the confiure ptb18 as GPIO function code will be generated in pin_mux.c file:

pastedImage_2.png

And it seems there is no difference when confgiure the "Direction" in "Routed Pins" on source code.

While you can refer to the gpio demo code , for example :
SDK_2.3.0_FRDM-KV31F\boards\frdmkv31f\driver_examples\gpio

it is simple:

pastedImage_3.png

About the use of MCUXpresso configure tool, you can clik  menu   Help->Contents:

pastedImage_4.png

Hope it helps


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

795 Views
vallisanghamish
Contributor II

Hi,

    Thank you for your inputs. I have configured the pins but the problem is I am trying to read the input value(EITHER 1 OR 0) through a GPIO port PTC9(WHICH I CONFIGURED) through an inbuilt function called

 GPIO_ReadPinInput(GPIO_Type *base, uint32_t pin) .

But this function is not returning a value (EITHER 1 or 0 ) whichever it receives and it is showing <optimized value>.

There is no example to do this functionality using GPIO pin.

I am sending the inputs to GPIO of KV31F(PTC9) from GPIO pin of FRDM K64F(PTB9).  Could you please tell me if this communication is actually possible and if so how should I proceed?

We have tried all possibilities for this but<optimized value> is only we are receiving. We are not able to establish a communication protocol in this way.

0 Kudos

795 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Valli,

Could you please first test a simple project ,for example only read the a simple pin.

I test on my side with TWR-KV31 board, configre PTC6 pin as input, high, then read it ,

work well:

pastedImage_1.png

And please pay attention to that , enable the gpio interrupt , otherwise it won't update:

pastedImage_2.png

About " <optimized value>." , where shows this ?

Hope it helps


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------