The ATmega328P & ATmega328...

In simple terms, the "P" immediately after the part number indicates a low-power (picoPower) device i.e. consumes less current although this all depends on how you use it.

The "P" after the hyphen "-" means a Plastic DIL (Dual In Line) package so an ATmega328P is a "picoPower", "Plastci DIL" device and an ATmega328 is a standard power "Plastic DIL" device.

As you lower the supply voltage and clock speed, device consumption is lowered so, running at 3.3V and 8MHz is better than 5V at 16MHz if you want to save power. The ATmel MCUs also have many sections of their internal circuitry that can be turned off if they are not needed such as internal clocks to various sections.

Don't forget, everything that you "drive" with the MCU such as LEDs, relays etc. adds to the overall current consumption so, the MCU consumption is probably the last thing you want to worry about. You will have to wade through the datasheet to find out more. However, don't try to drive too much from the AVR pins there is a total I/O specified for each AVR device. An Atmega328, for example, can source 40mA and sink 50mA on each I/O pin but, the total current for the entire AVR is only 200mA so that means 4 I/O pins at full current! Be careful and remember that this is what driver chips and relays are for.

The ATmega328P and the ATmega328 are NOT the same device!

If, like a growing number of Arduino users, you want to build your own Arduinos or build specific stand-alone projects, you will eventually want to buy and program your own micro-controllers.

If you want to build a battery powered project choose the Atmega328P device or, if saving a few milliamps is not paramount, save some money and opt for the ATmega328.

Although the ATmega328P and ATmega328 are functionally identical as far as memory, speed, registers etc. are concerned, choosing the wrong variant can cause a lot of problems where programming is concerned.

Every Atmel micro-controller has a unique identification code, or signature, built in which can be read by an external device such as a programmer.

Atmega328-P signature = hexadecimal 1E 95 14

Atmega328P signature = hexadecimal 1E 95 0F

So, what is the problem? The Arduino Uno uses the ATmega328P and all the support software including the AVRDUDE programming suite currently only recognises the ATmega328P*. If you replace an ATmega328P with an ATmega328 and try to program it, it will fail because the software sees the different signature, refuses to play ball and reports:

avrdude: Device signature = 0x1e9514
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
Double check chip, or use -F to override this check.


avrdude: Yikes! Invalid device signature. (this is more likely if AVRDUDE can't read the signature at all)

There are ways around this problem, some messy but, at the end of the day, if you don't want hassle, only buy Atmega328P chips. This tutorial explains the ins and outs of simple MCU programming and also deals with programming Atmega328-P devices.

Later, in this tutorial, I describe what I consider the easiest methods of programming the "non-standard" ATmega328-P devices. If you intend to use an Arduino as an ISP you will just need to use my modified ArduinoISP_Multi sketch (available from the download page). If you want to use another type of programmer such as the AVRSIP MKII I also provide a "fix" so, read on.

The ATmega328 is cheaper and if your project does not require low consumption components, use the Atmega328 by all means.

Also, while we're at it, consider if you really need to use a 16MHz crystal to provide the clock for your micro-controller? The Atmega328 range can be programmed to use their own internal clock source which runs at 8MHz, 1MHz or even 128KHz and, unless your project really needs precise timing or ultra fast processing, seriously consider doing away with the crystal oscillator. You also get 2 additional input/output pins (PB6 & PB7) where the crystal used to be!

*At the time of writing, January 2014, there is a new version of the AVRDUDE software i.e. version 6.0.1 which does support the ATmega328 but, it does not work with all programmers at the moment so we are stuck with the old software for now.