Receive data from usart(Asynchronous) when parity bit is set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-01-23 9:55 AM
I am using usart1 for asynchronous communication. Microcontroller is nucleo STM32F103RB.
Here's is how I am receiving data if parity bit is not set,
char USART1_Receive()
{ if((USART1_SR & 0x00000020) == 0) // no data available return 0; return USART1_DR;}My question is, how should I receive data if parity error occurs? How should I handle parity error?
#stm32f103rb #serial #usart- Labels:
-
STM32F1 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-01-23 10:00 AM
On the F1 you need to read the DR to clear the parity error, reception will be stopped until you do so.
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-01-23 11:02 AM
How do I request data re-transmission?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-01-23 12:32 PM
ST use XModem (or is it Zmodem?) in their IAP-over-UART examples...
https://en.wikipedia.org/wiki/XMODEM
https://en.wikipedia.org/wiki/ZMODEM
http://www.rogtronics.net/files/datasheets/micro_z80/xymodem.pdf
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-01-23 1:10 PM
A UART doesn't work that way, it tells you if you had a reception error (parity, framing, overrun, etc), the protocol you layer on top would need to manage errors and retransmission of data.
X-MODEM is a relatively light-weight protocol.
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-01-23 1:50 PM
Crude form of Y-MODEM (1K packets with CRC)
Up vote any posts that you find helpful, it shows what's working..
