Bootloading ATMega328P at 3.3v [MOVED TO CORRECT TOPIC - SORRY!]

Hi All and thanks in advance for the help!

I have created a few boards using the ATMega328P (-AU) at 5 volts but I am now trying to create one running at 3.3 volts so I don’t have to use vltage dividers on my logic interfaces.

I have looked at these two posts, which are helpful, but I still have a few questions:

https://forum.arduino.cc/?topic=596711#msg4052388

Based on my [probably too limited] understanding of the info in these posts, I have tried to upload the bootloader to my board as if it were an Arduino Pro Mini using the Arduino as ISP method. No luck.

Questions:

  • The first post tells me that I need to run the 328 at no more than 12 MHz:

  • Can anyone recommend a good external 12MHz resonator that is hand-solderable?
    I’m pretty good hand-soldering SMTs down to about 1206

  • Prior to loading a bootloader, I am guessing that the 328 runs off the internal clock
    If I supply 3.3v to it will it configure itself appropriately to receive my bootloader? Or
    perhaps it sees that I have an external clock hooked up and just uses that?

  • The second post tells me “You need an 8 MHz bootloader on the chip, if it is running at 8 MHz. You will need an ICSP programmer to do that.” (thanks jremington). Of course I am looking for 12MHz but point taken. I am assuming that an Arduino Mini or Pro Mini running at 3.3v must also be limited to 12MHz and therefore the Arduino as ISP should be trying to load my board with 3.3v settings (brownout detection < 3.3v and clock at 12MHz).

  • Bad assumption on my part?

  • Do I really need an ICSP programmer?

  • The first post also tells me that I can look at hardware\boards.txt. I am running the Arduino IDE on a Mac and I can’t find that. Can anyone tell me how to find that file?

Thanks!

vtmakr

I have several 328s running at 3.3V. I bootload them using an Uno as ISP (ArduinoISP example) and the MiniCore core. I set them to run on the 8MHz internal option. MiniCore has a 12MHz external option though I do not know if the 328 will run, reliably, at 12MHz on 3.3V (consult the data sheet).

If the 328 was running at 16Mhz before, you will need have the chip being programmed running at 16MHz to bootload with the 8MHz option.

To answer your one question, yes, you need an ICSP programmer any time you want to bootload an AVR processor. That includes changing a bootloaders baud rate.

A USBASP is highly recommended for this, configuring an Uno or a whatever board every time you want want to bootload a processor is just not worth the hassle for $3, it’s an error prone process if you’re not doing it every day. I prefer the version you can buy with the translucent case, the protection is well worth it. Don’t forget one of the 10 pin to 6 pin adapters if the Usbasp doesn’t include one. Total outlay for the package of a usbasp, cover, cable and adapter should be about $6 on eBay. It is good investment that will save you a lot of time if you’re bootloading more than once.

Any atMega328 that you purchase as a raw chip will have its fuses* set to operate with its internal clock at 8 MHz. This clock is not accurate enough to operate a serial connection reliably at higher baud rates, that’s why you see crystals and resonators used as the clock source.

    • they are not a fuse in the sense that they can be reprogrammed but that’s what Atmel calls the configuration settings stored in the processor’s eeprom.

The first post also tells me that I can look at hardware\boards.txt. I am running the Arduino IDE on a Mac and I can’t find that. Can anyone tell me how to find that file?

Don’t bother. Ancient post and info is outdated. Just install MiniCore and you’re done. Follow the instructions on Github.

A quick look at the datasheet shows that 12MHz needs 3.6 volts to be within the guaranteed operation range. 10MHz is the top end for 3.3 volts. Beware the older datasheets that show operation to 20MHz, that was before Microchip purchased Atmel and the subsequent process change.

Page 260: http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf

WattsThat:
Don’t bother. Ancient post and info is outdated. Just install MiniCore and you’re done. Follow the instructions on Github.

A quick look at the datasheet shows that 12MHz needs 3.6 volts to be within the guaranteed operation range. 10MHz is the top end for 3.3 volts. Beware the older datasheets that show operation to 20MHz, that was before Microchip purchased Atmel and the subsequent process change.

Page 260: http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf

Many thanks WattsThat. NO doubt saved me a lot of time and head scratching with that info re the new datasheet as I was using the old one!

I'll check out MiniCore.