Standalone Arduino 3.3V W/ External 8 MHz Clock, ISP from Uno, serial monitor

Howdy folks,

I recently had a particular goal I was trying to accomplish and didn't find any specific guide on how to do it. It took me about a week to figure it all out and figure it may help others out.

My goal was to create a 3.3V standalone Arduino with an EXTERNAL 8 Mhz clock that could be programmed via ISP (with serial monitor capabilities for prototype testing).

I managed to figure out a few hurdles and hope this will help others.

Why should you use the external 8MHz oscillator when the mcu has built in 8MHz oscillator ? And what are the problems that you experience in your setup ?

The 100nF decoupling capacitors aren't optional, they are required for stable operation.
There's also absolutely no need to change anything in boards.txt.

m_k_akash:
Why should you use the external 8MHz oscillator when the mcu has built in 8MHz oscillator ? And what are the problems that you experience in your setup ?

The internal oscillator isn't anywhere near as accurate as an external oscillator.

BJHenry:
The 100nF decoupling capacitors aren’t optional, they are required for stable operation.
There’s also absolutely no need to change anything in boards.txt.
The internal oscillator isn’t anywhere near as accurate as an external oscillator.

Thanks for the comment! I’ll edit it to ensure that people include them i.e. NOT optional!

I wrote it in as optional because it was somewhat working before hand, but you’re right, I don’t know why I wrote it as that.

In regards to editing boards.txt, I (along with several other members on Arduino forums) had problems uploading sketches to the standalone Arduino unless the brownout fuse setting was adjusted from whatever was on it (I assume 2.7V) to 1.8V.

m_k_akash:
Why should you use the external 8MHz oscillator when the mcu has built in 8MHz oscillator ? And what are the problems that you experience in your setup ?

As BJHenry said, an external oscillator is more accurate.

According to this, the internal oscillator could have a drift of 10%, and since I'm using the device with bluetooth and with very specific timing, I can't afford that.

Also, I HAD numerous problems with the setup, but I managed to figure it out. Are you asking what problems I did experience or what problems I have left? :slight_smile:

If you could, try answering both :slight_smile: :slight_smile:

According to this, the internal oscillator could have a drift of 10%

Only under extreme environmental conditions.

I've been using the internal 8 Mhz clock for years, in outdoor environments with temperature range -10 to 30C, and I have never seen drift of greater than about 1%.

In some remote sensor applications I use a 32kHz watch crystal on the XTAL pins (PB6 and 7) to calibrate the internal oscillator, and also as a clock source to use the ATmega as an RTC.

I didn't read through your entire instructables article, but a few points:

You do not need a level shifter, the atmege328 works fine at 8MHz with a 5 volt power supply. Only reason to run at 3.3 volt during programming is if there is some other circuitry connected to the chip that cannot tolerate 5 volts.

You do not need to edit any files, use mcuDude's MiniCore for custom configurations, although if you want to edit the boards.txt file, my preference would be to create a new entry for the custom board so as not to alter the standard board definitions.

If all you intend to do is burn the bootloader or actual code to the chip, and then socket it on another board for actual use, you do not actually need a crystal. There are versions of the Arduino as ISP sketch that output an 8MHz clock signal from the UNO board (Adafruit has one in their tutorials, only takes 8 lines of code in setup including comments), very handy when you do not have a crystal available and accidentally set the fuses for an external clock.

If you want to be able to program the chip using the USB-to-serial adapter, do not upload any code using the ISP, that will erase the bootloader. If you leave the bootloader intact, then you will be able to upload code over serial as you normally do for an arduino board.