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

problems receiving fast uart data #1

Open
uglyoldbob opened this issue Sep 11, 2019 · 5 comments
Open

problems receiving fast uart data #1

uglyoldbob opened this issue Sep 11, 2019 · 5 comments

Comments

@uglyoldbob
Copy link

I am having difficulty receiving uart data with this code (I am running an atmega16u2 on 8mhz). Data is inconsistently received (115200 8n1 data). The issue seems to be related to the time between bytes received (it is practically 0)

@tewarid
Copy link
Owner

tewarid commented Sep 12, 2019

I wonder if the host is sending baud rate using SetLineCoding. What host is the atmega16u2 board talking to?

@uglyoldbob
Copy link
Author

Ive measured the baud rate of transmissions (with an oscilloscope) and they appear to be spot on. In fact if i run a loopback cable, transmissions are received fine. It's when the received bytes are packed super densely that problems occur. (The external device is an embedded platform running u-boot).

@tewarid
Copy link
Owner

tewarid commented Sep 12, 2019

If I understand you correctly, at lower baud rates, let's say 9600, you don't see any issues. Correct?

@tewarid
Copy link
Owner

tewarid commented Sep 12, 2019

Try setting F_CPU and F_USB compiler flags to 8000000UL.

@uglyoldbob
Copy link
Author

Ive set both flags as such. I thought the issue was related to the length of idle time between bytes, but after comparing a working stream against a non working stream (both at 115200 baud) i didnt see a difference. Both had zero idle time between bytes.

Repository owner deleted a comment from yogeshkushwahait Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants