Loading a 3.3V bootloader on a 5v board

Hi!
I've searched the forum but didn't find a definitive answer...

If I load a 3.3V bootloader on a 5V board (i.e. a board originally loaded with a 5V bootloader, with a 5V voltage regulator, and with a 16MHz crystal), provided I choose the right bootloader for the right ATMega chip, do I have to cut traces to the soldered crystal (since the 3.3V bootloader is supposes to be running on the internal one) or not?

The question arise because I have a "wrong" micro that should be a 5V board (i.e. with a 5V regulator) but it has a 3.3V regulator instead (it took a while to sort it out) and a 16MHz crystal: I load sketches at 5V (through USB/FTDI 5V adapter) ad run the board at 3.3V (from a 9V battery) and everything works just fine.

I don't know if it has a 3.3V bootloader or a 5V one (in the latter case, I'm probably running the board a little under specs)... but before trying to change bootoader, I'd like to understand better the matter.

Thank you!

You are confused on a few things here, so let me see if I can clarify for you. I will assume this is an Atmega328p-based board (Uno, ProMini, etc), but the same principle applies to most Arduino boards.

There are no 3V3 or 5V bootloaders. The bootloaders are (typically) compiled for either 8MHz or 16MHz. If the board is powered with 3V3, then technically the chip is only guaranteed to run at 12MHz or less (the cap might be 10MHz, I don't recall offhand) or less. At 5V supply, up to 20MHz is in-spec. So, typically in Arduino land the 8MHz boards are powered with 3V3, and the 16MHz boards with 5V. But, many people have put a 16MHz crystal onto a board powered only by 3V3 and it runs fine (similar to overclocking a computer's CPU).

All the bootloader does is allow you to upload sketches over Serial instead of using an ISP programmer. The bootloader is compiled to expect a certain baud rate, which is based off the clock source.

What board are you selecting when you load a sketch? Can you post a picture/link to what you have?

Also, many Arduino 8MHz boards are still set to use an external crystal or resonator, not the internal resonator. Unless you change the fuses, it will still look for an external clock.

Assuming you are 100% sure you have a 16MHz crystal and a 3V3 regulator powering the chip, you have a couple of choices:

  1. Leave it as-is, but program it with a 3V3 VCC FTDI adapter (some have a switch or jumper to set voltage). Otherwise you are dumping 5V on the output of the 3V3 regulator which well may damage it.

  2. Remove the 3V3 regulator and replace it with a 5V one. This will mean some fancy hand-soldering as I assume it is a SMD regulator, but it can be done with care.

  3. Burn an 8MHz bootloader, set to fuses to use the internal clock, and cut the traces to/remove the 16MHz crystal/resonator.

Clock
Speed
Minimum
Voltage
4 1.80
5 1.95
6 2.10
7 2.25
8 2.40
9 2.55
10 2.70
11 2.88
12 3.06
13 3.24
14 3.42
15 3.60
16 3.78
17 3.96
18 4.14
19 4.32
20 4.50

Ah, thanks. I had never bothered to calculate out the full spread like that. So 13MHz is the maximum in-spec for 3V3, but 3V3 is not terribly out-of-spec for 16MHz, explains why so many folks can get it to work there just fine.

Yes, until they run into problems with Serial transfers getting flaky, or other unexplained things.

Hi,
thanks a lot for your answer.

I've got a clone board like this one: https://www.sparkfun.com/products/11113

It has a crystal with printed on 16.0MHz

The voltage regulator is a 3.3V one (guess it's some sort of mistake)

Uploading sketches, I used to select Arduino Pro or Pro Mini (5V 16MHz) w/ ATMEGA328 (before realizing the regulator is 3.3V) with a 5V FTDI board - now I know I risk to burn the voltage regulator...

Sketches were uploaded fine, so I assume it has a 16MHz bootloader

Sketches were working fine with direct 5V power supply

Since I've realized is has a 3.3V voltage regulator, I've tried a project with 3.3V components (OLED, Bluetooth) running on a 9V battery connected to Vin: OLED works fine, but I have problems in getting serial communication working over Bluetooth

From your answers I get that strange behaviours are probably due to the fact that I'm running it at 3.3V with a 16MHz setup... but how can it be that OLED works fine? and serial over Bluetooth does not?

How can I load a 8MHz (internal oscillator) bootloader? Do I have to cut traces to the crystal in this case?

Thanks!

Loading a 3.3V bootloader on a 5v board

Bootloaders do not run at voltages. Processors do.

Upload with a 3V3 FTDI (many of the adapters have a jumper you can solder to switch the voltage), and select the 5V/16MHz Pro Mini in Tools->Board. All the board selection does is compile the hex for the right chip at a certain clock speed. But since you are running outside spec with that voltage/clock speed combo, I would fix that issue.

As for why your OLED works, is it an SPI OLED or serial? If SPI, I would expect it to still work fine as the Atmega provides the clock as opposed to both devices assuming a certain speed.

How can I load a 8MHz (internal oscillator) bootloader? Do I have to cut traces to the crystal in this case?

Yes, if you change to the internal oscillator I would cut the traces to the resonator (it isn't a crystal on the Pro Mini), or just remove it entirely. The bootloader is the same as the regular 8MHz one, you just need to change the fuses to use the internal oscillator. See Nick Gammon's pages on the fuses and how to change them. The easiest thing for you might be to just use the second link and burn the Lilypad bootloader, which should set the fuses to use the internal for you (I think - can't find confirmation of this on the Burn Bootloader page Nick?). Then you can remove/cut the resonator and off you go.
Fuse Reader
Burn Bootloader

You can leave the resonator there. Don't cut any links. The Lilypad bootloader uploader sets the fuses to use the 8 MHz internal oscillator. With it set to that it ignores any attached crystal / resonator.

madmattd:
As for why your OLED works, is it an SPI OLED or serial?

I'm using SPI, in effect it does make sense!

I'll try to load the Lilypad bootloader then, since my problems with the serial connection through the Bluetooth module...

Thank you