Sunday 1 January 2017

atmega - Using a 16 MHz crystal on a ATMega328p


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



Answer



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.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...