UART1 dual identical pins in K64

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

UART1 dual identical pins in K64

Jump to solution
1,160 Views
roymessinger
Contributor V

In K64 I've noticed there are multiple pins (all are ALT3 as well) for the UART1 interface: pins 1,2 & 73,76 for RX,TX.

Is there any difference between them? or how should I use them?

I've tried using UART1 on the FRDM K64 (K64 pins 73, 76 for RX, TX) and it doesn't work, trying to understand why...

kerryzhou‌/ mjbcswitzerland‌ - do you know?

Thanks.

Tags (1)
0 Kudos
1 Solution
836 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Roymessinger,

   I have modified your interrupt code, now it can work with PTC3,PTC4, UART1. I have test it on my FRDM-K64 board.

Please unzip my attached .c file to your project.

 

 

Wish it helps you!

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

0 Kudos
4 Replies
837 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Roymessinger,

   I have modified your interrupt code, now it can work with PTC3,PTC4, UART1. I have test it on my FRDM-K64 board.

Please unzip my attached .c file to your project.

 

 

Wish it helps you!

Have a great day,
Kerry

 

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

0 Kudos
836 Views
mjbcswitzerland
Specialist V

Roy

The input/outputs of the UARTs can be multiplexed to a number of different pins. Any set can be chosen but only one should be used at a time.

I use these to route UART1 to the pins that you want:
_CONFIG_PERIPHERAL(C, 4, (PC_4_UART1_TX | UART_PULL_UPS));       // UART1_TX on PC4 (alt. function 3)
_CONFIG_PERIPHERAL(C, 3, (PC_3_UART1_RX | UART_PULL_UPS));       // UART1_RX on PC3 (alt. function 3)

The simulation below shows the pins as required and I attached a binary that can be loaded to the FRDM-K64F that shows this combination in action (at 115'200Baud - it will send text at reset and respond to input with a command line menu). In the I/O menu it is possible to look at the internal register values in case you need to see the values set to the UART and GPIO configuration registers.

pastedImage_1.png

Regards

Mark


Professional support for Kinetis: http://www.utasker.com/index.html
Remote desktop one-on-one coaching: http://www.utasker.com/services.html
Getting started to expert videos: https://www.youtube.com/results?search_query=utasker+shorts

0 Kudos
836 Views
roymessinger
Contributor V

Ok, Mark. Thank you.

Unfortunately, your bin does not work wither, which lead me to believe that something with my setup is wrong.

I've connected the FRDM as follows:

The small board below is an RS485 to UART. The UART RX is connected to J2/4 (TX), the UART TX is connected to J1/16 (RX).

GND & Vcc is connected to J199 GND & Vcc (I've left it there because I've used to work through UART4 - works great with that setup, now I want to move to UART1).

Any idea you can think off?

What you referred to 'respond to input with a command line menu)' will also be seen in the Real term, when clicking something or only with your GUI? How do I download your GUI?

Thanks,

Roy

123.jpeg

Ok,here's an update:

Using your bin, when I reset the board, I get on my Real term:

'rs 485 example'

But they are shown when I'm connected to the UART of the OpenSDA (UART0). I've double checked it. In UART1 (where my RS485 to UART is connected) I don't get anything.

I even disconnected my USB dongle (which converts USB to RS485, and then it goes to the small board) and still, when reset is clicked I get this string in Real term.

Thanks anyway for your help.

Roy

0 Kudos
836 Views
mjbcswitzerland
Specialist V

Roy

"rs 485 example" doesn't exist in the binary so it must be coming from somewhere else (are you sure your RS485 cable works and could it be that you haven't loaded the binary correctly, or loaded the wrong one?).

This is the logic analyser output of PTC4 on J2/4 (Tx UART1 of K64) when I load the binary to the FRDM-K64F:

pastedImage_1.png

As you can see, it sends "Hello World - Kinetis....." at 115200 Baud.

Note that the green LED flashes at 2.5Hz when it is operating normally.

The output is just UART so can be talked to with Real term, TeraTerm, or whatever terminal emulator you want.

This means that

- you may not have correctly loaded the binary file (I do it with drag-and-drop using the OpenSDA loader).
- or your RS485 convert is not working, or is connected incorrectly
- or you have some other HW problem

Note that to generate a working reference for you I take the uTasker project, I set the target to FRDM_K64F, then I change
#define DEMO_UART    0 to 1

and build it with whichever IDE I want (choice of 10 different ones). This took me about 50s of work to generate a reference for you.

The project is open source at http://www.utasker.com/forum/index.php?topic=1721.msg7086#msg7086
and would allow you to save huge amounts of your time since it contains all that you need, that works without any effort due to the fact that it has been used and tested in hundreds of K64 developments.

Regards

Mark

0 Kudos