How to change parity at runtime

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

How to change parity at runtime

888 Views
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 Kudos
Reply
1 Reply

820 Views
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 Kudos
Reply