STM32 UART+Circular Buffer+parity bit
Posted: Mon Feb 10, 2020 11:54 am
Hello.
Maybe my topic isn't new, because I want to fix parity bit in my application, but I need some help to solve the problem correctly. Benji wrote a little abut that in older posts. Port settings should be modified to 9-bit, but also adding some calculations are necessary. Because I'm using circular buffer to receive data, should I change it to 16bit? There are 2 optons: 8bit or 16bit. Maybe only 8 bits should be put into the buffer. Could someone modify added simple source code? It will be very helpful not only for me I think. Base code ralize 9600, 8-bit,no parity. I'm trying to realize 9600, 8-bit, parity ->even. UART macro have no possibility to check even, odd or no parity bit.
Thanks for any help in that point.
Maybe my topic isn't new, because I want to fix parity bit in my application, but I need some help to solve the problem correctly. Benji wrote a little abut that in older posts. Port settings should be modified to 9-bit, but also adding some calculations are necessary. Because I'm using circular buffer to receive data, should I change it to 16bit? There are 2 optons: 8bit or 16bit. Maybe only 8 bits should be put into the buffer. Could someone modify added simple source code? It will be very helpful not only for me I think. Base code ralize 9600, 8-bit,no parity. I'm trying to realize 9600, 8-bit, parity ->even. UART macro have no possibility to check even, odd or no parity bit.
Thanks for any help in that point.