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

Serial Loopback with ATMega328p-pu #34

Open
tenderlove opened this issue Dec 23, 2017 · 2 comments
Open

Serial Loopback with ATMega328p-pu #34

tenderlove opened this issue Dec 23, 2017 · 2 comments

Comments

@tenderlove
Copy link

tenderlove commented Dec 23, 2017

Hi,

I'm trying to get the serial loopback from Chapter 5 working with my ATMega328p-pu chip. I've tried changing F_CPU as well as updating the fuses, but it seems that no matter what I change the fastest I can get is 3600 baud. I'm not sure if I'm doing something wrong, or if 3600 baud is the fastest this chip can do (without an external crystal).

Thanks in advance!

@tenderlove
Copy link
Author

Just to be specific, I am able to get the chip to echo characters back to me, I just have to set the baud on my local client to 3600 for the characters to be correct. It doesn't matter what baud I set in the Makefile, it's always 3600 on my client. I've verified it's actually recompiling the code and reflashing the chip. I've also tried changing the fuses. If I manually define USE_2X in my source, it does impact the speed, it's just stuck at 19200 rather than 3600.

@tenderlove
Copy link
Author

I've ended up setting F_CPU= 8000000UL and setting LFUSE = 0xE2 to disable the clock divider. This let me use 19200 for the baud without manually defining USE_2X. However, it doesn't seem to matter what I set BAUD to, I always get 19200 speeds.

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