Go Down

Topic: Advice for Stand-alone Atmega 328 at 3.3V (Read 3183 times) previous topic - next topic


I've searched the forum for tips on this topic, but I'd like some advice before I purchase more hardware. Any help is much appreciated.

My current set-up is a stand-alone board with an Atmega328p (preloaded with Arduino bootloader) with 5V power and a 16MHz external crystal. I've loaded a code on the chip to collect and store data from an accelerometer and heart rate monitor to a micro-sd card using an interrupt service routine. To get 3.3V power for these sensors, I've included a voltage regulator on the board. This set-up is working great, but I'd like to make the system portable using a Lithium Polymer battery and reduce my power supply to only 3.3V.

Based on what I have read, I know a 8MHz crystal is needed with a 3.3V supply. What effect will switching the clock speed have on the execution of the code? Specifically, does anyone know if lower the clock speed will impact the interrupt service routines? Is there an easy way to test this using an Arduino development board with the 16MHz crystal?

To switch to the 8MHz crystal and 3.3V set-up, does anyone have a good summary of the steps needed to change the clock speed? Are there any changes to the bootloader?



you will need a external programmer to set the atmega's fuses to run at 8 mhz

a crystal is not really necessary if your project is not super dependent on accuracy over long periods of time (the chip has a 8mhz oscillator built in)  

and everything will run at half the speed


Are there any changes to the bootloader

Yes, you have to switch to a 8MHz bootloader (Lilypad or any 3.3 Volt)

You can use a second Arduino as Programmer (code=ArduinoISP); however it might not work at the first try: Lots of threads from frustrated noobs here in the forum..


What effect will switching the clock speed have on the execution of the code?

It makes it slower, half the clock speed and any given piece of code takes twice as long to run. But you knew that didn't you?


Based on what I have read, I know a 8MHz crystal is needed with a 3.3V supply.

Have you tried 16MHz with 3.3 V supply? While this is not within the spec, most setups I have used work perfectly even with voltage reduced to 3.3 V.

If it is not a mission critical application, I'd suggest giving that a try first.


Sep 08, 2010, 03:28 pm Last Edit: Sep 08, 2010, 03:28 pm by mpeuser Reason: 1
The theory behind this is, that you need a certain "energy" = V*I/f to switch a transistor. So if f increases either I or V should also increase. As this energy is mainly lost through capacitances, the increase of V is only the second best approach (that is why we have 1.8 volt logic in high performance cores, with VERY high currents flowing!). However "I" is as it is in a given chip, so the supply voltage should be increases with the used clock. However there are no hard limits....


Thank you all for your suggestions.

I will try the 16MHz with 3.3V supply first and see if I run into any problems. The device will be taken out into the hot California sun so it will need to make it through that test unscathed.

I'll also try reprogramming with a 8MHz clock and see if my code can still run at a slower speed.

Thanks again.

Go Up