Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8693945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:39:51+00:00 2026-06-13T00:39:51+00:00

I am writing some code for a microprocessor to communicate with an external device

  • 0

I am writing some code for a microprocessor to communicate with an external device via asynchronous serial communication over a single wire.

I can recognize a transition on the wire from low/high (either way), so I can find the bit boundaries. Given that I know the baud rate the device is using I can then start clocking off bits, so I can read the stream of bits coming from the device.

What I’m struggling with conceptually is recognizing a start bit – finding the start of a byte frame (assuming I’m getting 8 bit, no parity, 1 start bit, 1 stop bit). I understand that each frame begins with a start bit and ends with a stop bit, but it is my understanding that start and stop bits look like any other bits – so there’s nothing special about them that identifies them as start or stop bits (other than their position).

The only way I can think of to identify a start bit is that it will be the first high bit after a sustained idle period – that is, since I’m expecting 8 bits no parity, if I get 9 or more low bits then the line is idle, and the next high bit will be a start bit. That’s all fine, but what if I start listening to the device mid-bitstream and there is no idle time of 9 bits or more on the wire? I am clocking off bits, but how do I recognize which bit is a start bit so I can read off a byte? If I’m clocking off bits, then anything in between frames can only be integer multiples of bits (so a stop “bit” can’t be 1.5 bits for example), so everything just looks like bits.

I hope I’m making sense… thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:39:52+00:00Added an answer on June 13, 2026 at 12:39 am

    The start bit is what gets your code to receive a byte going. Best explained with a state machine. You’ve got 4 basic states:

    • State “wait”: sample the data line. When you see the start bit then start a timer at 1.5 * bit-time and move to state “data”
    • State “data”: wait for the timer then sample the data line to record a bit. Restart the timer to 1.0 * bit-time. Repeat as long as you haven’t received all bits. Move to state “stop” when all bits received
    • State “stop”: wait for the timer and sample the data line to check the stop bit. Move to state “error” if it is wrong, add a byte to the receive buffer if it is not. Back to state “wait”.
    • State “error”: complain. Wait for deus ex machina to go back to state “wait”.

    So basic insights from this is that you need the start bit to get the code going that receives a byte. And that the stop bit is important so you can reliably see the start bit for the next byte.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm writing some code and using RegistryKey.GetValue and I can't seem to get
I was writing some code where I have a class that can accept mixins
I am currently writing some code that can access a separate workbook through an
I am writing some code to generate anchor elements via Ajax call to the
I'm writing some code that uses a Tree (a regular tree that can have
I'm writing some code that will need to speak to a web service over
I'm writing some code where the UI thread need to communicate with the background
I am re-writing some code for a new re-design and I am wondering if
I'm writing some code that will take a screenshot of another application, given its'
I'm writing some code for a very limited system where the mod operator is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.