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

USART.c ATmega16A fix. #42

Closed
cmacu4 opened this issue May 12, 2019 · 0 comments
Closed

USART.c ATmega16A fix. #42

cmacu4 opened this issue May 12, 2019 · 0 comments

Comments

@cmacu4
Copy link

cmacu4 commented May 12, 2019

When trying to compile for the first time I got this:
Capture
So in USART.c I change "UBR0H" to "UBRH", "UBR0L" to "UBRL" etc. until the code compiled. But when I finally got to actualy using the USART I had to make one last tweak before the serialLoopback.c code worked.
Change:"UCSR0C = (1 << UCSZ01) | (1 << UCSZ00);"
to: " UCSRC = (1 << UCSZ1) | (1 << URSEL) | (1 << UCSZ0); "
This is because you need to set the URSEL bit when you write to the UCSRC register.

@cmacu4 cmacu4 closed this as completed May 12, 2019
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

1 participant