Can two devices with different Serial communication Settings work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-05-31 5:02 AM
I am working on STM32F030Xc MCU. Which I set UART settings as: 7- bit, None parity, 2 stop bits, And its connected with PC terminal with settings 7-bit, Even parity, One stop bit. So both MCU and PC should not communicate isn't it? But they are! And not only communicating but data is also correct sent and received! How? Please guide me.
#learning-stm32 #stm32f-uart- Labels:
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-05-31 5:38 AM
>>Please guide me
To do what?
The data is sent least significant bit first, the parity and stop bits trailing. The form remains pretty consistent despite the settings.
On the ST side the width includes parity, so 7E would bit 8-bit mode, 7N 7-bit mode, and 8O 9-bit mode, for example.
On the PC the receiver will show you data with parity that is valid, and hide the data that is not. You might want to try some different terminal software to see if that behaves differently, or send character values in the 32 to 126 range and confirm you can see at both ends. Things like RealTerm can also display data bytes in hex form.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-05-31 5:25 PM
I guess your PC software is ignoring the parity error.
of course it works, if you ignore parity, only 7 bits at a time, perfect for ascii, but slower than using HEX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-05-31 11:01 PM
So how do I prevent this communication on ST side? How do I make sure that ST should reply only to the data that is according to UART settings set in ST and not to reply if its not?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-06-01 12:08 AM
Run the ST side in 8-bit mode and check the parity, or in 9-bit mode and check for both parity and the stop bit? If you run in 7-bit mode you'll likely have any usable info in the high order bits masked, and perhaps get a framing error if the UART dislikes the pattern is sees. If you want to see the additional data on the wire use 9-bit mode.
What constitutes valid data, and how would you reply to it, or indicate is it invalid?
Perhaps you can provide data to support your observations? And the data/response you want/expect?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-06-01 1:13 AM
Thanks for your suggestion. I don't have any logic to consider a data as valid or invalid. But I just wanted that ST should only communicate with device having same serial settings.
