ATMEGA328P standalone with 8MHz external crystal

Hell everyone!

I’ve spent my entire week trying to figure this out, but without any luck.

I’m working on a project that needs to run at 3.6v so using the ATMega328P @16Mhz is unstable and not recommended. So I figure the best solution would be to run it at 8Mhz (with an external crystal for better accuaracy)

The problem is that I don’t know how to change this. I’ve read several post here and other forums, even try to use optiboot but that [optiboot] only mess my head up.

I don’t care if I need to use the UNO as ISP or if I can directly upload sketches from Arduino IDE (v1.6.9), I just need it to work for now, then I’ll go a little deeper

Could someone please provide an easy how-to?

Thank you very much, and please excuse my English is not my native language.

Setup up your project like a 3.3V 8 MHz Promini board. Bootload it to set the fuses up, then download away.

Calculate the External 8mhz external clock fuse from here http://www.engbedded.com/fusecalc/

change the cpu setting in board.txt as below.

atmega328bb.build.f_cpu=8000000L

Well thank you both for your replies!

So, there are two ways to do it: A- As CrossRoads suggested, use the Pro Mini Board configuration B- As sarouje said, change the values in the board.txt (or copy and replace to create my own board)

I'd like to have a step by step guide so, if I understood correctly, that would be:

For A 1- Select ProMini Board 3.3v 8Mhz 2- Connect to my custom board (using FTDI cable or ISP?) 3- Select Tools->Burn Bootloader 4- Upload Sketch from arduino IDE (using FTDI cable)

I'm not sure about the connection. I can burn the bootloader using FTDI or I need to do it using ISP?

For B I'm not enterly sure, I've looking at the fuses calculation, I don't understand why I cannot use the same fuses as the UNO and only change atmega328bb.build.f_cpu=8000000L

Thanks again!

You need to use ISP for bootloading.

You cant use default uno board, fuse setting will be different for 8mhz external clock. Default uno board uses 16mhz clock.

Burning pro mini option is a good idea but I haven't tested. But it should work.

Thank you very much you both!

I've manage to burn ProMini Bootloader and then upload code to the ATMega328P using Arduino UNO board (I don't have FTDI cable)

Is there anyway I can tell it's running at 8MHz from external crystal instead of internal oscillator? I guess that to confirm that I should check Pro Mini fuses in board.txt right?

Thank you, thank you, thank you!!!

To test the internal or external crystal, try uploading a sketch with and without crystal. I could see if I bootloaded the chip to use external crystal and the absence of a crystal makes the chip dead and will not respond to sketch upload commands.

The thread you have posted here on more or less the same subject is attracting similar and overlapping answers. http://forum.arduino.cc/index.php?topic=409565.0