Problem with k64f uart3 receiving bad data

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

Problem with k64f uart3 receiving bad data

751 Views
rayleigh415
Contributor I

Hi, I'm working on the frdm k64f board and i'm trying to initialize the uart3 and send data in and out. I have been trying to figure out this, debugging, researching, and trying different examples but still no success.

For uart0 which uses the micro USB interface just works straight from the demo apps. However, when I configure the uart3, I am getting data back but the data seems to be wrong and contains noise. Here is the first setup that I tried on uart3 PTC16/17.

c016c592-176c-4afd-aebe-10d509b2d9d9.jpg


My most recent attempt was following this example UART3  because it was confirmed successful by someone else (FRDM-K64F - UART3 Issues With KSDK 2.0). So data was coming back fine on uart1, here's the output:

ascii:
Uart functional API interrupt example
Board receives characters then sends them out
Now please input:

hex:
55 61 72 74 20 66 75 6E 63 74 69 6F 6E 61 6C 20 41 50 49 20 69 6E 74 65 72 72 75 70 74 20 65 78 61 6D 70 6C 65 0D 0A 42 6F 61 72 64 20 72 65 63 65 6 9 76 65 73 20 63 68 61 72 61 63 74 65 72 73 20 74 68 65 6E 20 73 65 6E 64 73 20 74 68 65 6D 20 6F 75 74 0D 0A 4E 6F 77 20 70 6C 65 61 73 65 20 69 6E 70 75 74 3A 0D 0A 00

When I initialized the uart3 (PTB10/11) and followed the example EXACTLY, I am getting back data, however just like the other times, it's not expected data, here's the output:

in ascii:
f3<?`?fó†ž<`?†žþžøž<àž˜`33˜˜†ž`?f<??f?Ÿ`?˜†üfÀfÏðÏfÃf€æž<?`<ÃfÃæàfÃf̆~3xóü`ÌàÌfÀ†øfÀæàófÆøæøÀæÌfÆž˜øfÆž`<?ÌÌfÃfÏÀÌžf?`?怘€ø˜þž~?ÀÏfÃfÀæøfÃÀ̘†žŸf?`?˜˜03`

in hex:
66 33 06 3C 18 3F 60 3F 00 18 0F 66 F3 86 9E 1E 3C 60 3F 86 9E FE 9E F8 9E 06 3C E0 9E 00 98 00 19 60 33 18 33 00 98 98 86 9E 60 3F 66 3C 18 3F 18 3F 66 06 F0 06 F3 06 60 CC C3 06 FC 66 C0 66 CF 06 F0 06 CF 66 C3 66 0F 0C 06 0C 80 E6 9E 06 3C 18 3F 60 3C 00 18 C3 66 C3 E6 E0 66 C3 66 CC 86 7E 33 78 F3 FC 06 60 CC E0 06 CC 66 C0 86 F8 66 C0 E6 E0 06 F3 66 C3 86 F8 E6 F8 06 C0 0C E6 06 CC 66 C3 86 9E 00 98 F8 66 C3 86 9E 60 3C 1E 3F 00 18 CC 06 CC 66 C3 66 CF 06 C0 CC 9E 66 3F 60 3F E6 80 98 80 F8 98 FE 9E 7E 3F 00 18 C0 06 CF 66 C3 66 C0 E6 F8 66 C3 06 C0 CC 98 86 9E 00 9F 66 3F 60 3F 98 98 1E 30 33 60 00

I also captured it on a Logic Analyzer and I am seeing these red F's, can anyone help explain? I am really scratching my head. Thank you.

Capture.PNG

Attached is also the full capture.

Any help is appreciated.

Thank you,

RT

Tags (1)
0 Kudos
2 Replies

483 Views
mjbcswitzerland
Specialist V

Hi Ray

It is possible that you are specifying the wrong clock speed for the UART and what you are seeing is the data being sent slower than expected (measure the bit time to be sure rather than the decoded data which looks to be seeing unexpected parity or stop bits). Remember that UART 0 and 1 in the K64 are clocked from the system clock and the others from the bus clock and so they generally need different Baud settings.

To solve such weaknesses with the libraries that you use take the uTasker open Source project and its simulator which gives high quality code and fool-proof UART (in interrupt and DMA modes) that works compatibly on all parts (UART, LPUART, all Kinetis devices and channels). Its simulator will show you the details and warn you of any issues and you can use it as reference to sort out such issues with other libraries.

pastedImage_1.png

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis K64:
- http://www.utasker.com/kinetis/FRDM-K64F.html
- http://www.utasker.com/kinetis/TWR-K64F120M.html
- http://www.utasker.com/kinetis/TEENSY_3.5.html
- http://www.utasker.com/kinetis/Hexiwear-K64F.html

UART: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF


Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M

0 Kudos

483 Views
rayleigh415
Contributor I

Thank you so much for the reply Butcher. 

Let me give this a shot thanks, I'll let you know if it works.

0 Kudos