How to change parity at runtime

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

How to change parity at runtime

891件の閲覧回数
steve_erickson
Contributor I

Using CodeWarrior 10.5, Kinetis MK12DX and Processor Expert.  For AsynchroSerial component, is there a way to change the parity, width and stop bits at runtime?

0 件の賞賛
返信
1 返信

823件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Steve Erickson o,

    In my own opinion, you can modify the register directly, don't need to use the API.

   Please note, if you want to enable the parity, then you need to modify data bit to 9bits to keep the data still be 8 data.

 Just

1. UARTx_C1[M]=1 Use—start + 9 data bits (MSB/LSB first as determined by MSBF) + stop.

     9 data bits is 8 bit data+1 bit parity.

 2. UARTx_C1[PE] =1 Parity Enable

 3. UARTx_C1[PT] =0 even parity, 1 odd parity.

pastedImage_1.png

  Wish it helps you!


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信