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

avr 328p, crystal and leds #52

Open
sjomae opened this issue Sep 22, 2023 · 1 comment
Open

avr 328p, crystal and leds #52

sjomae opened this issue Sep 22, 2023 · 1 comment

Comments

@sjomae
Copy link

sjomae commented Sep 22, 2023

If a crystal is used, this does make DDRB unusable for using it for the LEDs, as in the book? Or is there a trick to make it work?
The crystal is covering up the PB6 and PB7 pins.

Related:
#24

@hexagon5un
Copy link
Owner

Hi,

Yes it does -- those two pins are dedicated to the crystal oscillator amplifier internally, so if you use a crystal you can't use them as GPIOs.

For learning, I thought it was useful to have a full 8-bit block of GPIOs available. It makes the whole "write to a register, and corresponding LEDs light up" much more intuitive.

But when you need more speed, you can get it by using those two pins for a crystal.

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