Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stop bit time. #374

Merged
merged 1 commit into from
Oct 2, 2024
Merged

Fix stop bit time. #374

merged 1 commit into from
Oct 2, 2024

Conversation

iabdalkader
Copy link
Contributor

@iabdalkader iabdalkader commented Sep 11, 2024

After transferring the last stop bit the TX GPIO needs to stay high until the trigger timer cycle is complete, otherwise the stop bit time will be short and the receiver may fail to decode it.

I tested baudrates 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200, and all of them can be decoded successfully by the scope. All baudrates up to 19200 have a stop bit time exactly the same as the bit time. For example 9600:

SDS00006

For baudrates higher than 19200, the stop bit time looks like it's slightly longer than nominal bit time, but this is just because it starts to get less than the time required to loop around and send the next byte. The worst case for 115200 is around 8us:

SDS00007

Fixes arduino/uno-r4-library-compatibility#12

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Sep 11, 2024
After transferring the last stop bit the TX GPIO needs to stay
high until the trigger timer cycle is complete, otherwise the
receiver may fail to decode a stop bit.
@pennam pennam merged commit 0281be5 into arduino:main Oct 2, 2024
7 checks passed
@iabdalkader iabdalkader deleted the stop_bit_fix branch October 2, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SoftwareSerial (FAIL)
4 participants