ATMEGA328P fuse setting same for 16MHz and 8MHz external crystal?

EDIT: Ah, found an answer after posting this question. It seems you can't. I'll have to find a way to reburn the fuses for 8MHz somehow.

Hello,
If I have an ATMEGA328P's fuses set to run on a 16MHz external crystal, and I want to run it at 3.3V instead of 5V in unfavorable conditions and want to lower the clock, would I just need to swap out the 16MHz crystal for an 8MHz crystal? According to the fuse bit calculator here, there is no 16MHz external crystal fuse bit setting. The available settings for external crystal are in these ranges: AVR® Fuse Calculator – The Engbedded Blog

0.9 - 3.0 MHz
3.0 - 8 MHz
8 MHz

So 8MHz and 16Mhz external crystal are the same fuse bit?

I've been looking quite a bit, but couldn't find a definite answer other than the fuse bit calculator table.

Yes, same settings.

Look at boards.txt, see if the fuses are set differently between a 3.3V/8MHz Promini and 5V/16MHz Promini - probably find just a slight change for brownout detection settings.

I just decided to go for it and try it out. It didnt' work. An LED blinking at 1 second will start blinking at 2 seconds w/ the 8MHz crystal. I also couldn't download new sketches to the chip when I used an 8MHz crystal. I think there's some kind of scale multiplier that needs to be set when you change external crystal frequencies...I remember coming across that, but couldn't find it again.

Nick Gammon's method for bootloader burning doesn't seem to provide an easy way of burning bootloaders other than the two options he programmed in (16MHz external, 8Mhz internal). I'm still searching for a boot loader burning method that let's me set an 8MHz external clock with the correct multiplier.

Bootload the board as an 8 MHz ProMini.

pro328.name=Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328

pro328.upload.protocol=arduino
pro328.upload.maximum_size=30720
pro328.upload.speed=57600 <<< download speed

pro328.bootloader.low_fuses=0xFF
pro328.bootloader.high_fuses=0xDA
pro328.bootloader.extended_fuses=0x05
pro328.bootloader.path=atmega
pro328.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
pro328.bootloader.unlock_bits=0x3F
pro328.bootloader.lock_bits=0x0F

pro328.build.mcu=atmega328p
pro328.build.f_cpu=8000000L <<<<<<<<<<<< This tells the code the clock speed
pro328.build.core=arduino
pro328.build.variant=standard

CrossRoads:
Look at boards.txt, see if the fuses are set differently between a 3.3V/8MHz Promini and 5V/16MHz Promini - probably find just a slight change for brownout detection settings.

I see what you mean. Looking at boards.txt in the Arduino system folder, I see the fuse settings. But even looking at the fuse calculator, I'm unsure if there is a difference between 8MHz external crystal and 16MHz external crystal. My functional test suggests there is? And I'm not certain which boards with the 8MHz setting are using the internal vs. external crystal.

This lists the boards:

The closest match seems to be:

Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328
An ATmega328 running at 8 MHz (3.3V) with auto-reset. Equivalent to LilyPad Arduino w/ ATmega328.

But these boards (Pro and Pro Mini) come in 16Mhz and 8MHz favors, and the schematic show an external clock, but it doesn't say whether the schematic is for the 8Mhz or 16Mhz version of the pro/promini. And it seems to get worst, the Pro Mini comes in ATMEGA328 and ATMEGA128 flavors. The official schematic shows an external crystal, but only on the ATMEGA128 version...couldn't find a Pro Mini 328 schematic showing a crystal. Arduino, document your flavors!

pro5v328.name=Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328

pro5v328.upload.protocol=arduino
pro5v328.upload.maximum_size=30720
pro5v328.upload.speed=57600

pro5v328.bootloader.low_fuses=0xFF <<< same as 8 MHz
pro5v328.bootloader.high_fuses=0xDA <<< same as 8 MHz
pro5v328.bootloader.extended_fuses=0x05 <<< same as 8 MHz
pro5v328.bootloader.path=atmega
pro5v328.bootloader.file=ATmegaBOOT_168_atmega328.hex <<< Not the same
pro5v328.bootloader.unlock_bits=0x3F
pro5v328.bootloader.lock_bits=0x0F

pro5v328.build.mcu=atmega328p
pro5v328.build.f_cpu=16000000L <<<< Not the same
pro5v328.build.core=arduino
pro5v328.build.variant=standard

arusr:
looking at the fuse calculator, I'm unsure if there is a difference between 8MHz external crystal and 16MHz external crystal.

arusr:
I just decided to go for it and try it out. It didnt' work. An LED blinking at 1 second will start blinking at 2 seconds w/ the 8MHz crystal. I also couldn't download new sketches to the chip when I used an 8MHz crystal.

there is virtually no difference in fuse settings between 8mhz and 16mhz. your difficulties are do to the the fact that the avr is running at different speeds which is what happens when you change crystals. nothing at all to do with fuses. you will also find that the same bootloader works at both speeds... no need to flash a different one... its only necessary to cut baud rate in half.

So on a 8MHz external clock, the delay(x) will actually delay twice as long instead of properly delaying the x number of ms? That's seems like odd behavior.

I still couldn't download to a regular bootloader ATMEGA328P-PU using an 8MHz crystal however. I had to swap out the crystal for a 16MHz one in order to download via FTDI adapter.

arusr:
So on a 8MHz external clock, the delay(x) will actually delay twice as long instead of properly delaying the x number of ms? That's seems like odd behavior.

That would be what would happen if you don't tell the IDE/compiler that the clock frequency did change. When one selects a board type the IDE looks in the specific board type in the boards.txt file where there is a parameter of the clock speed that board uses, so that the parameter can be passed to the delay and millis, etc functions that are dependent on actual avr clocks speed. If you edit the board's clock speed entry in the board's board.txt then the delay, millis() will be accurate once again.

I still couldn't download to a regular bootloader ATMEGA328P-PU using an 8MHz crystal however. I had to swap out the crystal for a 16MHz one in order to download via FTDI adapter.

Again there is an parameter entry in the board's type in the board.txt file that tells the IDE what baud rate to use when it uploads a new sketch via the bootloader on the board. If you edit the value then uploads will work with 8 mhz change in clock speed.

retrolefty:
That would be what would happen if you don't tell the IDE/compiler that the clock frequency did change. When one selects a board type the IDE looks in the specific board type in the boards.txt file where there is a parameter of the clock speed that board uses, so that the parameter can be passed to the delay and millis, etc functions that are dependent on actual avr clocks speed. If you edit the board's clock speed entry in the board's board.txt then the delay, millis() will be accurate once again.

Again there is an parameter entry in the board's type in the board.txt file that tells the IDE what baud rate to use when it uploads a new sketch via the bootloader on the board. If you edit the value then uploads will work with 8 mhz change in clock speed.

yes, that's it. Thanks for spelling out everything.

arusr:
So on a 8MHz external clock, the delay(x) will actually delay twice as long instead of properly delaying the x number of ms? That's seems like odd behavior.

yes, if clock is half speed than everything takes twice as long. i doesnt seem odd to me at all.

arusr:
I still couldn't download to a regular bootloader ATMEGA328P-PU using an 8MHz crystal however. I had to swap out the crystal for a 16MHz one in order to download via FTDI adapter.

you can use the same bootloader w/o flashing a new one if you change the baud rate to half in the arduino menu.

or you can load a different bootloader and re-edit and re-compile the program as lefty says. personally i am the laziest man on earth so choose to change as few things as possible.

CrossRoads:
Bootload the board as an 8 MHz ProMini.

pro328.name=Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328

pro328.upload.protocol=arduino
pro328.upload.maximum_size=30720
pro328.upload.speed=57600 <<< download speed

pro328.bootloader.low_fuses=0xFF
pro328.bootloader.high_fuses=0xDA
pro328.bootloader.extended_fuses=0x05
pro328.bootloader.path=atmega
pro328.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
pro328.bootloader.unlock_bits=0x3F
pro328.bootloader.lock_bits=0x0F

pro328.build.mcu=atmega328p
pro328.build.f_cpu=8000000L <<<<<<<<<<<< This tells the code the clock speed
pro328.build.core=arduino
pro328.build.variant=standard

Does this mean by altering this value (pro328.build.f_cpu=8000000L) to the actual crystal frequency, timers will be more accurate?

I would like to use the atmega328p to keep time. If I use the internal oscillator I loose a few minutes every hour, which is not good. If I use the external 16mhz crystal the timing is much better at about 1 sec loss every few hours. But I would still like to improve that. I would also like to run the processor at 8mhz for lower voltages. Would using an external 8mhz crystal be more accurate than the 8mhz internal resonator?

So if any of this is correct, how do I measure the actual frequency? Does any pin output this?

Cheers