9
\$\begingroup\$

How would I need to set my fuse bits on a ATMega328p to use a 16MHz crystal? I tried this on my own and killed the last atmega I had. I'd like some advice this time.

The crystal I am using is this one

I am assuming this is a "Full Swing Crystal Oscillator" as listed in the datasheet, so CKSEL3..1 should be 011

Then I need to set the startup time. I'm assuming the "Crystal Oscillator, slowly rising power" is the safer option so CKSEL0 should be 1 and SUT1..0 should be 11.

I don't want to divide the clock by 8 so CKDIV8 should be 1

CKOUT I will leave at the default of 1

If my assumptions are correct (and how do I verify that?) my lfuse bit settings will be 0xf7.

Am I doing this right?


This didn't work. See here

\$\endgroup\$
6
\$\begingroup\$

Arduino uses low fuse setting of 0xff for ATMega328p, which is the same as 0xf7 except crystal is not programmed as full swing. Full swing is recommended for speeds over 8MHz and especially if multiple units use same clock source.

\$\endgroup\$
5
\$\begingroup\$

I use this: http://www.engbedded.com/fusecalc/

\$\endgroup\$
4
\$\begingroup\$

For ATmega*8 chips, one of the best resources to crib from is the Arduino "boards.txt" file It contains settings for many common chips and configurations.

\$\endgroup\$
2
\$\begingroup\$

Try using AVRFuses. Thats what I use for all my fuses and it works fine.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.