UART problem on K60 (parity)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

UART problem on K60 (parity)

ソリューションへジャンプ
3,118件の閲覧回数
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 件の賞賛
1 解決策
1,612件の閲覧回数
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 件の賞賛
5 返答(返信)
1,612件の閲覧回数
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 件の賞賛
1,612件の閲覧回数
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 件の賞賛
1,612件の閲覧回数
UniversalTroope
Contributor III

Exactly the same problem on UART 1.

 

Has anyone successfully used parity on any Kinetis UART?

0 件の賞賛
1,613件の閲覧回数
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 件の賞賛
1,612件の閲覧回数
mjbcswitzerland
Specialist V

Hi

 

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

 

Regards

 

Mark

 

0 件の賞賛