UART problem on K60 (parity)

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

UART problem on K60 (parity)

Jump to solution
3,159 Views
UniversalTroope
Contributor III

Hello, I'm having some problems with UART3 on the K60 Tower board (Rev. C) (the one that's connected to the RS232 port on the serial board).

 

I'm trying to send data out, but when I want to use parity, I get only garbage (verified on two computers, with two different serial cables).

 

The included source file replaces nill.c in the MQX 3.7 example nill.

 

I'll be very happy if someone can see where the problem is, or even just verify the problem on their K60/serial board.

 

0 Kudos
1 Solution
1,653 Views
anthony_huereca
NXP Employee
NXP Employee

Make sure the terminal settings are set up correctly. In 8-bit mode, the 8th bit is the parity bit, and thus you only have 7 data bits. So make sure the terminal is setup for only 7-data bits.

 

If you need 8-data bits, then the UART should be setup in 9-bit mode.

 

See the note in Section 51.3.8 or section 51.4.4.1in the RM.

 

-amh

View solution in original post

0 Kudos
5 Replies
1,653 Views
UniversalTroope
Contributor III

Thanks! Setting options to 9 databits solved the problem.

 

I'm using the MQX driver, and not bare metal. It seems like something the MQX driver should take care of, or at least should be mentioned in the serial driver section of the MQX I/O drivers user guide. Maybe it's a standard way to do it, and I just have insufficient serial port driver experience, but it's not exactly logical.

0 Kudos
1,653 Views
anthony_huereca
NXP Employee
NXP Employee

How each part implements parity can be different. So while on Kinetis it means you only have 7 data bits, on a S08 part it still might mean you have 8. So it does requires a little bit of knowledge of the part in this case, since the driver is just turning on parity for your part, and doesn't know neccesarily what you "meant" to happen. Someone else moving from bare-metal to MQX might think it odd if it didn't take away a data bit for example :smileyhappy:

 

-amh

0 Kudos
1,653 Views
UniversalTroope
Contributor III

Exactly the same problem on UART 1.

 

Has anyone successfully used parity on any Kinetis UART?

0 Kudos
1,654 Views
anthony_huereca
NXP Employee
NXP Employee

Make sure the terminal settings are set up correctly. In 8-bit mode, the 8th bit is the parity bit, and thus you only have 7 data bits. So make sure the terminal is setup for only 7-data bits.

 

If you need 8-data bits, then the UART should be setup in 9-bit mode.

 

See the note in Section 51.3.8 or section 51.4.4.1in the RM.

 

-amh

0 Kudos
1,653 Views
mjbcswitzerland
Specialist V

Hi

 

See also page 25/40 of http://www.utasker.com/docs/KINETIS/uTaskerV1.4_Kinetis_demo.pdf

 

Regards

 

Mark

 

0 Kudos