K22 UART2/PIN MUX

cancel
Showing results for 
Search instead for 
Did you mean: 

K22 UART2/PIN MUX

Jump to solution
596 Views
burgeh
Contributor IV

Greetings,

I am currently using the MK22FN256VLH12 with KDS v3.2 and Processor Expert.

I am trying to use the UART2 port (Pins 59 (PTD2) and 60 (PTD3)), however I keep running into this error. I have not had any issues before like this.

pastedImage_1.png

I checked the referenced component 'Pins' and it leads me to my general IO component for PortD. Below is what 'Pins' displays.

pastedImage_2.png

But nothing really shows up here. Port D pin 2 (pin 59) shown. I think it must be something with the wake-up pin.

pastedImage_3.png

Below is the Pin settings again under the wake-up. P13 (pin 59) is not assigned.

pastedImage_4.png

My guess is that it thinks Pin 59/60 are in use because the current IO pin has it mux'ed to be used elsewhere such as the wake-up pin. However, I am not sure how/where to resolve this.

Any Suggestions would be appreciated! Thanks!

1 Solution
213 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Christopher Burg,

    Yes, you are right, PE component can't select two component with the same pin.

   But if in your Bluetooth you just want to control pin PTC3, you totally don't need to use the component.

   You can configure the PTC3 pin as GPIO, and set it to the output, then you can use your

    pastedImage_2.png

About the PTC3 initialization with register.

  SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;// enable port C clock gate

  PORTC_PCR5 &= 0xFFFFF0FF;

  PORTC_PCR5 |= PORT_PCR_MUX(1) | PORT_PE_MASK|PORT_PS_MASK;

Wish it helps you!

If you still have question about it, please kindly let me know.

Have a great day,
Kerry

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

View solution in original post

7 Replies
213 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Christopher,

    I have created a project on my side, but I don't have your problem:

pastedImage_1.png

I also attach my project, you can refer to it.


Have a great day,
Kerry

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

0 Kudos
213 Views
burgeh
Contributor IV

Kerry,

Below is an image of my project obviously more components. There is a LLWU component, but it is not enable and I've deleted it and it still has that issue. Could you try and and GPIO port D component?

pastedImage_1.png

0 Kudos
213 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Christopher,

  Thank you for your updated information.

   From your description, your other component should also use the PTD2 and PTD3, that will cause the problem.

   You said you select the LLWU, but you didn't enable it, you can delete it, I find your BT1 also have problem.

   If you are convenient, you can share your problem project, I will help you to check it.

   From you first post, the error is caused by the difference component pin conflict.


Have a great day,
Kerry

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

0 Kudos
213 Views
burgeh
Contributor IV

Kerry,

The Bluetooth is the component that I added and I am trying to get to work, and also be able to have the other components. Am I just not able to have both Bluetooth and GPIO components in the same project?

pastedImage_1.png

On kind of a side note, I am a bit unfamiliar with this method of setting registers, but I want to turn Pin 46 PTC3 on and off with these macros. (Where can I reference these register settings?) They don't appear to be effective. I confirmed on my scope. Any thoughts?

pastedImage_2.png

pastedImage_3.png

Thanks!

0 Kudos
214 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Christopher Burg,

    Yes, you are right, PE component can't select two component with the same pin.

   But if in your Bluetooth you just want to control pin PTC3, you totally don't need to use the component.

   You can configure the PTC3 pin as GPIO, and set it to the output, then you can use your

    pastedImage_2.png

About the PTC3 initialization with register.

  SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;// enable port C clock gate

  PORTC_PCR5 &= 0xFFFFF0FF;

  PORTC_PCR5 |= PORT_PCR_MUX(1) | PORT_PE_MASK|PORT_PS_MASK;

Wish it helps you!

If you still have question about it, please kindly let me know.

Have a great day,
Kerry

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

View solution in original post

213 Views
burgeh
Contributor IV

The PORT_PE_MASK and PORT_PS_MASK are not defined. Is there a header file I need to include or where can I find these values? Also where are you referencing to do this?

0 Kudos
213 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Christopher Burg,

   Don't worry, you also can use these code to replace PORT_PE_MASK and PORT_PS_MASK :

PORT_PE_MASK : (1<<1);

PORT_PS_MASK: (1<<0);

0 Kudos