Skip to main content
7 events
when toggle format what by license comment
Dec 11, 2022 at 8:36 vote accept Arseniy
Dec 10, 2022 at 20:23 comment added Justme It works on any MCU that supports 9 bit data setting. AVR is an 8-bit MCU with 8-bit registers, and yet it supports 9 data bits. The register bitness has really nothing to do with that. If an MCU does not support 9 data bits then this check can't be done. And yes, does not work for 9N2 formats, but 9 bit data is not supported by PCs anyway.
Dec 10, 2022 at 16:58 comment added Arseniy "9N1 format and check the 9th data bit yourself" sounds like semi-software solution. It does't work for 9N2 format and it does't work on MCUs with 8-bit register for received data. But it's a very interesting trick. Thank you. I think we can say that the manufacturers of MCUs and UART bridges commonly do not provide a fully hardware solution for second bit checking. Which means that this check de-facto is considered redundant.
Dec 9, 2022 at 22:31 comment added Justme No software emulation. Set the MCU UART to 9N1 format and check the 9th data bit yourself, that's the first stop bit, the second stop bit is handled by hardware as the real stop bit.
Dec 9, 2022 at 19:40 comment added Arseniy I don't understand a little, how to check both stop bits with the STM32 when its datasheet says the opposite. It says that corresponding frame error flag of the USART register does not rise if second stop-bit corrupted (without any exception). Do you mean an USART emulatuon with the software?
Dec 9, 2022 at 17:44 comment added Justme Not customary, but with the versatile UARTs of microcontrollers, including the AVR and STM32 you mentioned, it is easily possible to check both stop bits. Even DMX512 standard suggests to check both stop bits if possible, but allows checking only the first.
Dec 9, 2022 at 12:57 history answered Arseniy CC BY-SA 4.0