This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How quickly can I change parity on a UART

Hello,

I am trying to force the UART on the am335x_evm to use a 9-bit protocol using the stick parity.  I will set the parity to 1 for address bits and 0 for data bits.  The data will be coming from user space through a write system call.  The plan was set the parity even, write the address data to /dev/ttyO0, change the parity to 0, write the message data to /dev/ttyO0. 

My question is, when does the parity change take affect?  If it happens before all the address data is out will this cause the address data to now have a parity of 0?

  • Hi Tim,

    To verify whether the serial port settings were changed successfully, you can use the call tcgetattr() and check whether the changes were made before writing data.....right???  Are you using the call, tcsetattr() to change the parity?

     

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------

  • What I need to do is set the parity to 1 then send out some address data.  I then need to turn around and change the parity to 0 and send out some data.  I am simulating a 9-bit protocol.  I need to know when it is safe to change that parity from a 1 to a 0.  If there is still some of the address bits that have not been sent out the UART and I change the parity to 0 will that change the parity of the bits sitting in the UART's send buffer?