I am using MKL14Z64VLK4. I can not get the UART0 receiver to work. I have it transmitting but not receiving. I can setup the same registers on UART1 and it works fine. Any ideas?

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

I am using MKL14Z64VLK4. I can not get the UART0 receiver to work. I have it transmitting but not receiving. I can setup the same registers on UART1 and it works fine. Any ideas?

1,166 Views
hamidmemar
Contributor I

I even put it in internal loop-back.  I see the idle line flag get asserted, but no data.

0 Kudos
9 Replies

913 Views
hamidmemar
Contributor I

This problem happened again and I finally figured it out.  Once the UART report and overrun, it no longer receives until you clear the overrun flag.  That was the problem.

0 Kudos

913 Views
hamidmemar
Contributor I

What I was doing was to poke values into registers within the debugger.as it turned out for what ever reason, when I poked value in the UART data register, this value did not come back on the next read and the FIFO full flag was not raised (too fast of read). When the same worked fine for UART1.

I thought it may be timing on the part of JTAG reads of the registers.  So I wrote a fairly simple tight loop to write to data register and wait for flag and then read the register.  This showed that it was working fine.

Also I found a bug in the code I was working with that caused the status to always return FIFO empty.

0 Kudos

913 Views
egoodii
Senior Contributor III

Where your 'initial experiments' led you astray is that the ARM debug architecture doesn't have the concept of a 'protected read'.  That is, the register-reads by the debugger to update the GUI contents are the SAME as 'code reads', and as such attempts to 'debug your way thru' flag and read-once registers (like RXFIFO!!!) means the 'register display' window will 'read and clear' data-available flags before you can even see them.  I know, this makes debugging peripheral drivers 'more difficult'...

0 Kudos

913 Views
hamidmemar
Contributor I

I figured my problem out.  Thanks for your response.

0 Kudos

913 Views
petec20
Contributor III

Hamid,

Consider posting your solution for the benefit of forum members.

0 Kudos

913 Views
petec20
Contributor III

Is your port MUX for UART0_RX set correctly?

0 Kudos

913 Views
hamidmemar
Contributor I

I believe I am setting it correct.  But I can not get the loop back to work.  Setting the pin MUX for UART 1  did not make a difference, therefore I thought I should not make a difference on UART0.  I think if I get the loopback to work, the UARt will work.

0 Kudos

913 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Hamid Memar

Could you share your project to replicate your issue? what IDE are you using?

Best Regards

Jorge Alcala

0 Kudos

913 Views
hamidmemar
Contributor I

I have not made any changes to the generated code by Kenetis design studio.  As I mentioned before, poking the same values in the UART1 registers makes it work.  At this time I am only trying to get the loop back to work.

0 Kudos