ATMEGA328P with 16MHz crystal at 3.3V - Inside/Outside spec if CLK divisor = 2?

I've picked up some m328p based development boards that have an external crystal (or resonator) fitted and a 3.3V regulator fitted. The regulator supplies the m328p, an RFM69 radio transceiver and an optional flash chip. I used Nick Gammons code (reply #14) to determine a rough approximation of the external crystal/resonator frequency. All indications are that it's around 16MHz, which is outside the manufacturers spec for 3.3V operation.

So, can I bring it in spec as it were, by setting the system clock prescaler to "divide by 2", giving an 8MHz clock to the rest of the chip? Obviously a very small portion of the chip will have to handle the 16MHz clock to divide it by 2.

The datasheet (Microchip 2018 - DS40002061A) hints that this approach might be ok. Section 9.6 - Calibrated Internal RC Oscillator - table 9-11 note 2 says "If 8MHz frequency exceeds the specification of the device (depends on VCC), the CKDIV8 Fuse can be programmed in order to divide the internal frequency by 8."

Ok, that scenario is talking about the 8MHz internal RC oscillator being too fast for the chosen operating voltage.

But, can I infer that dividing a 16MHz external clock/resonator by 2 is ok for 3.3V?

I don't know the answer, but the bootloader would presumably be running at 16 MHz, so any problems might show up there. The safest thing would be to flash a new bootloader and fuses so the MCU runs off the 8MHz internal oscillator.

Thanks for the reply. The photo below shows the crystal / resonator that's fitted to the board.

I think the "crystal" (the device to the left of the 328p) is probably a resonator. I don't have any experience of using resonators as i've previously used proper crystals. If it is a resonator, then it's likely to have the same sort of accuracy as the internal 8MHz RC oscillator.
The devices on the board are using either I2C or SPI so they don't care if they system clock is out by 10%.

Well I think a resonator will still be more accurate than the internal oscillator. But it probably only matters for UART stuff.

I have seen somewhere a calibrating bootloader which lets you adjust it the first time it's powered up, and that would give you a pretty solid 8MHz. But I think you would have to create a board definition for this setup to get it to work properly. You would have a special 8 MHz bootloader and special fuse settings (for using the internal oscillator). I don't know how to do that.

Thanks for that. I've built a few optiboot bootloaders so that's not a problem.

I did have a tiny85 bootloader that did something like that. If I recall correctly, it used the timing of the bits in a byte from characters from an external serial device to tweak the timing.