7

Now I have these Arduino Pro Mini from Sparkfun. They are the latest version that I know (yeah, it's the one that have those horrible misaligned pins). Now they are designed around the ATmega328P and have a 16MHz crystal on them.

Now, my question is: Can I run an ATmega328 with a 16MHz crystal while supplying ONLY 3.3V.

The reason I'm doing this is because 5V / 16MHz Pro Minis from China are way cheaper then 3.3 / 8MHz.

Facts that I already know:

If I follow the datasheet to the the letter, this configuration should not work. BUT... After some test, it did work.

Also, I want an answers based on personal experience (NOT OPINIONS) and not datasheet and specs.


[EDIT] Including a way to use the internal clock (at 8MHz) of the ATmega328P would really help!

Nick Gammon
  • 38,901
  • 13
  • 69
  • 125
Dat Ha
  • 2,943
  • 6
  • 24
  • 46

7 Answers7

9

Officially, no. Practically, often but not always.

If I follow the datasheet to the the letter, this configuration should not work. BUT... After some test, it did work.

The data sheet does not say that it "should not" work, it says that it is that the part is not qualified for operation at 16 MHz below some voltage higher than you want to use. That does not mean that a given chip cannot work there, it only means that a chip that fails to may not be considered "bad". Failure may be total and obvious or subtle.

In practice I have seen it work, both on small modified import boards and those with switchable power supply voltage. But I also recall seeing it fail to work.

Two factors that can make a theoretical difference are part-to-part manufacturing variation and operating temperature.

Note that with an ISP setup you can change the fuses to run the chip on what was sold as a 5v external crystal board, to operate from the internal 8 MHz oscillator instead, and you can do this even while leaving the crystal on the board. If you also change the brownout detector fuse, you can lower the voltage further, for example to operate without a regulator directly on two AA cells. Of course that applies to the ATmega itself - any other active components on the board would have to be qualified for the intended voltage too.

Chris Stratton
  • 5,411
  • 20
  • 40
5

According to the datasheet you need 3.78V to run at 16 MHz, and 3.3V isn't that far off. I would be surprised, for example, if it stopped working at 3.77V, because that would mean that the operating at 3.78V was marginal.

I have operated these chips out of spec, for example under voltage, or with a 24 MHz crystal. They seem to work. However I would guess that Atmel's position would be: if you operate out of our specs, don't come crying to us if it is unreliable.

A few percent out of spec will probably work - and 3.3V is 87% of 3.78V. They write those specs to allow for fluctuations in the manufacturing process, and are confident that all their chips would meet them. Probably a lot of chips would be over spec.


Including a way to use the internal clock (at 8MHz) of the ATmega328P would really help!

Set the fuses appropriately. See Engbedded Atmel AVR® Fuse Calculator

For the Atmega328P making the low fuse be 0xE2 should do it.


The reason I'm doing this is because 5V / 16MHz Pro Minis from China are way cheaper then 3.3 / 8MHz.

Be cautious that cheap clone boards may be manufactured with manufacturers' "seconds".

Nick Gammon
  • 38,901
  • 13
  • 69
  • 125
4

A little test, not very scientific, but shows it runs fine on 3.3V - https://www.youtube.com/watch?v=If0eOa0Uj5I.

Again, if you would like to stay withing the specification just use a "clock divider/2" and run your MCU at 8MHz if they have a 16MHz Crystal:

clock_prescale_set(clock_div_2)

http://www.nongnu.org/avr-libc/user-manual/group__avr__power.html

Talk2
  • 579
  • 3
  • 5
3

I've built a few 3.3v home-brew-duinos with 16Mhz crystals (because I have a bag of 50 xtals!) - they run fine in the conditions I've put them in so far (on my desk). Some of them may be closer to their margins than others, and might fail at at some otherwise in-spec temperature, for example. If these were intended to go outside (enclosed, of course), I'd have to test them against the conditions they might be subjected to. Or redesign them to keep them in spec in the first-place.

I think the only way to know is to try it on your board and see. I don't have or know of a test-suite for the chip; I've just uploaded known-working sketches to my experimental boards and had no obvious glitches. Yet.

JRobert
  • 15,407
  • 3
  • 24
  • 51
1

I am running my atmega328p chip with 3.3 volts because I did not wanted to use a voltage divider when powering the NRF24L01 that is part of my circuit. Because I only have 16mhz crystals and I don't know how to lower the frequency to 8mhz I been running my project with 3.3v and it works great. I been running this code for over a year and I have had no problems.

The code works great even at 2.8v running at 16mhz. At 2.65v it stops working.

Tono Nam
  • 966
  • 1
  • 10
  • 22
1

You can use the clock prescaler in conjunction with the CKDIV8 fuse to operate with an 8MHz clock but using a 16MHz crystal.

See the "CLKPR – Clock Prescale Register" details in the data sheet for details (Page 36 in my data sheet 07/2012).

Basically you set the CKDIV8 fuse so the processor runs at 2MHz after power-up. Then once up and running you set the division ratio to 2 which would give 8MHZ operation which is guaranteed at 3.3V.

Kevin White
  • 261
  • 1
  • 1
1

Atmega48/168/328's datasheet graph (under "29.3: Speed Grades") presents maximum safe clock speed for given VDD voltage. It consists of three mathematical functions - 1 constant and 2 linear. I managed to calculate their formulas and sum them up:

formulas

where:

x is a VDD voltage [V] and y - max safe clock speed [MHz] you can achieve with the voltage. I've done it, because I've had a need to check, if 3.3V power supply is enought for a 12MHz crystal - and it is (around 13,3MHz max.).