Uart1 to Uart 0 communication problem for KL25/26

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

Uart1 to Uart 0 communication problem for KL25/26

1,525 Views
ronakpanchal
Contributor I

Hello Everyone,

 

I am facing the issue with UART1 of KL26/25 in transmit.

I have pickup the example "lpsci non blocking example" for KL26 and did some changes(added UART1)

 

My requirement is I want to rx/tx from two MCU.

During debugging I observed that rx tx is working fine when I short the rx/tx of UART1 on the same board means able to receive on UART0.

 

When connected to other MCU (KL26z) and transmit the data, not able to receive data properly even though on same baud rate.

 

 

Thanks in Advance.

 

Regards,

Ronak

Original Attachment has been moved to: fsl_lpsci_irq.c.zip

Original Attachment has been moved to: main.c.zip

Labels (1)
0 Kudos
5 Replies

843 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Ronak Panchal:

We are sorry for the delay to respond.

About your sentence:

During debugging I observed that rx tx is working fine when I short the rx/tx of UART1 on the same board means able to receive on UART0.

I got confused, does it work with UART1 or UART0 using the same board?

Are you trying to link two KL25, two KL26 or KL25 with KL26?

At first glance I am not sure if you are configuring the pins for UART1. The original example only configures the pins for UART0 calling the function configure_lpsci_pins(0) inside of hardware_init().

Let me know such details and I will be glad to help.

Regards!

Jorge Gonzalez

0 Kudos

843 Views
ronakpanchal
Contributor I

Hello Jorge,

Thanks for your reply.

I have connected Uart1 of KL26Z with Uart0 of KL25Z and configured at same baud rate (115200).

Also  Uart1 pins are configured in hardware_init().

Testing scenario:

     1. send data from Uart1 of KL26Z to Uart0 of KL25Z with baud rate 115200.     - Not received properly.

     2. Removed the connection from KL25Z and shorted TX/RX of Uart1 of KL26Z with baud rate 115200.  - Able to receive data properly on Rx what ever is sent on TX.

     3. changed the baud rate to 57600 and reconnected KL25Z as given in first scenario. - Received properly.

I required to use the baud rate of 115200.

Given image is of KL26z Uart code flow.

AS explained in testing scenario 2. TX/RX of Uart1 is shorted , able to receive data back on putty termial.

But when connected to other MCU(KL25Z) not getting proper data on Uart0 of  KL25Z.

The main problem is two MCU is not communicating at 115200 baud rate. Uart problem.png

0 Kudos

843 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Ronak Panchal:

I made some tests with FRDM-KL25Z and FRDM-KL26Z and I have the same results as you, it works with 57600 but not all bytes are received correctly at 115200.

I am guessing that the issue is that the pins for UART0 (PTA1 and PTA2) in FRDM-KL25Z are shared between the I/O header J2 and the OpenSDA interface. Try removing the resistors that connect such pins to the OpenSDA interface:

pastedImage_2.png

Let me know if that helps or the issue persists.

:smileyinfo: Just for your reference I am attaching the projects I used to test on KL25 and KL26.

Regards!

Jorge Gonzalez

0 Kudos

843 Views
ronakpanchal
Contributor I

Hi jorge,

I have not removed the resistor.but i think it is not the issue of KL25Z.

Earlier i have tested it with K22F board (same code as KL26z). It's working proper.

So what could be the other cause that creates problem.

Regards,

Ronak

0 Kudos

843 Views
ronakpanchal
Contributor I

Hello jorge,

Thanks for your inputs.

I will let you know after testing.

Regards,

Ronak

0 Kudos