Question about USART??
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-21 7:17 AM
Posted on February 21, 2014 at 16:17
PLz can some one tell me why we must ''&'' the received value with 0x7F!!!!!!
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-21 8:04 AM
Posted on February 21, 2014 at 17:04
''PLz can some one tell me why we must ''&'' the received value with 0x7F''
There is no absolute need to bit wise AND with 0x7F! It is probably there to support 7bit data width for the RS232 standard.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-21 8:20 AM
Posted on February 21, 2014 at 17:20
It is probably there to support 7bit data width for the RS232 standard.
Or strip parity, ST's definition of data bit includes the parity bit, the USART_DR can contain up to 9-bits. Masking covers a couple of ill's including stopping some compilers warning as you cast from a 16-bit unsigned int to an 8-bit signed/unsigned char. There is generally much disagreement as to whether a char is signed or unsigned, many compilers/os have their own ideas, with defaults, or overrides.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-21 2:31 PM
Posted on February 21, 2014 at 23:31
thks 4 help :)
