Time to retire ATmega328P?

If they were obsolete, the distributors would all have them listed as "Discontinued", "End of Life", etc. and they are not:


I think we do not give the same meaning to the word "obsolete".
Probably our culture are not the same side of the Atlantic.

Here, "obsolete" does not mean "not found", it means that it's products or methods of the past.
To day you can always write your mail with a typewriter even it is "obsolete", there always exists that work but I think you're using a PC with a word processor and printer. :grin:

adjective
1.
no longer in general use; fallen into disuse:
an obsolete expression.
2.
of a discarded or outmoded type; out of date:
an obsolete battleship.
3.
(of a linguistic form) no longer in use, especially, out of use for at least the past century.
Compare archaic.
4.
effaced by wearing down or away.
5.
*Biology. *imperfectly developed or rudimentary in comparison with the corresponding character in other individuals, as of the opposite sex or of a related species.

You are correct, my understanding of the word as it relates to electronics does not fit any of those definitions. If a part is still being manufactured & consumed by the mass market and the manufacturer continues to supply and support it, it is not obsolete.

The PIC has some disadvantages - 3.3V output and only 10mA supply current, so of limited use for driving LEDs (could be limited to Red only), small motors, transistors, couldn't drive small telecom relays - so all the stuff that the '328P is good for in embedded projects without needing extra components.
More expensive - $3.15/100 vs vs $2.71/100 (digikey pricing)
Does have nice features for software projects, if you're into writing big software projects.

robtillaart:
For me there is one issue that the AVR does not solve

  • support for double (64 bit) math - preferably in HW.

I have seen many posts (esp GPS related) where floats just are not precise enough.

I was thinking of writing a library for that sort of thing, but the coding would likely be too complicated for me.

As for myself, I wonder whether floating-point arithmetic really belongs on an AVR. If it were up to me, I would just use fixed-point arithmetic and be done with it.

floats are mostly easy for us mere humans, when we do not need to have an exact number.

If I count apples I want to be exact. If I want the distance to the moon, I want an order of magnitude and that is where floats come in.

@Odometer
BY chance do you have a link to a good fixed point lib that includes functions like sqrt and trigonometry?
(I'm familiar with the big number lib )

Found this one - Google Code Archive - Long-term storage for Google Code Project Hosting. - for my todo list

@Odometer
BY chance do you have a link to a good fixed point lib that includes functions like sqrt and trigonometry?
(I'm familiar with the big number lib )

Found this one - Google Code Archive - Long-term storage for Google Code Project Hosting. - for my todo list

Not good, only 16 bits after the radix point.
Maybe use it as a model to construct a more precise library, though.

I wonder if it would be OK to use, say, 64-bit integers. I wonder which would be better, 16.48 format or 32.32 format.

No one is saying ATMEGA328 is obsolete. What is starting to be outdated are the 8 bit architectures. ARM (in all its flavours) is the future; and for the embedded market the Cortex M branch is the future.

LPC824 is better than ATMEGA328

LPC824 is better than ATMEGA328 in all aspects, from performance to price. For the Arduino's end user the change to a newer architecture (in regards to the Arduino One) is painless.

Some interesting features that should be taken into account for the Arduino designers are:

a) LPC824 is faster (Up to 30 MHz). It includes its own 12 MHz on-chip oscillator at 1.5% accuracy. On-chip oscillator + on-chip PLL = core running at 24 MHZ
b) LPC824 is cheaper
c) 32 bit bus lets do more work with less programming instructions
d) 16 bit instructions means more code in less flash
e) Imagine all you can do with 8 KB in RAM
f) Better power-save profiles. It means you might power the board with batteries
g) Better peripherals
h) No external programmer other than a UART.
i) 12-bit ADC with a sample rate up to 1.2 Msamples per second
j) One of my best LPC824 features: the SWITCH MATRIX. If you are not aware of what this means here is a short explanation: you can move any peripheral function to (almost) any pin (power pins are not movable).
k) All that and many more features plus the Cortex-M0+ beauties: 32 bits bus, 16 bit instructions, NVIC and SysTick included at the very kernel.

I might continue listing the LPC824 features but it's better that you can see it by yourself:

http://www.mouser.com/ds/2/302/LPC82X-466467.pdf

Drawbacks: SMD only, no fixing your board by replacing the chip. Need the 32-pin leadless part to get a comparable qty of IO as the '328P.

32K Flash, 8K SRAM. I could see a lot of the flash being used for setting up the flexible hardware configuration.

('1284P has 128K flash, 16K SRAM. And available in a DIP (not an official board, but pretty handy).)

"High-current source output driver (20 mA) on four pins." Not the handiest - need to add external hardware for simply driving LEDs for example, leading to a multichip board right off the bat.

Does have a lot of nice features. The input switch matrix would need to be addressed by the IDE - I can see lots of confusion there getting that set up.

Maybe have the SMD part as a module to go on a board so it could be swapped out when folks smoke it.

LPC824 is better than ATMEGA328 in all aspects

That seems doubtfull.

c) 32 bit bus lets do more work with less programming instructions

For some operations. An m328 AVR can set or toggle an IO bit (or a byte register bit) in a single 16bit instruction. Not so an ARM.

d) 16 bit instructions means more code in less flash

Most AVR instructions are also 16 bits.

g) Better peripherals

More complicated peripherals.

OTOH, Switch Matrix is pretty awesome. (although... I'm not exactly sure how to take advantage of it in an Arduino context.)

Have you implemented an Arduino "core" for LPC824? If so, how big is "Blink." One problem I've seen with a lot of the ARMs is that the vendor libraries are not very space-efficient. That used to be fine, when most of the chips had 128k+ of flash memory (like Due and Zero), but it starts to worry me on these smaller (32k or less) chips...

I'm very new to this domain. May I ask a silly question? Is there any bread-board for smd parts? Do the ARMs have ADC/DAC built-in? Do they have a large flash+eeprom+ram inside? Do they run at 5V? Are they easy to solder? Is there any veroboard for smd parts? If all these meets I will jump to arm. Otherwise I think people those who are learning will be using DIP based AVRs but 8-bit DIP AVRs will be educational and instructional purpose tool only, may be used when prototyping a project, the same is true to the 'Through The Hole' parts also.

Many ARMs have ADCs and DACs. The Arduino Due has a large ARM chip with both of those features, as does Teensy 3.1.
The Due is 3.3V only and cannot take 5V inputs, while the Teensy operates at 3.3V but will tolerate 5V on its inputs.
EDIT Also, many ARMs cannot supply much current on their outputs. That makes it hard to power LEDs.

Is there any bread-board for smd parts?
Is there any veroboard for smd parts?

The usual solution is something like a breakout board that will plug into a breadboard, or a less-specialized "Schmartboard" (specifically designed to be easier to solder.) Such stuff appears all over Tindie. Of course, if you were moving to ARM for lower cost, these "extras" would blow your budget.

Do the ARMs have ADC/DAC built-in?

Yep.

Do they have a large flash+eeprom+ram inside?

Yep.
I just picked an STM32L476 "Discovery" Board (MSRP about $20). The chip has 1M Flash, 128K RAM, 12bit A2D and D2A, 6 uarts, native USB, and more.

Do they run at 5V?

Mostly not, but some do. Atmel has announced a "SAMC" series that has 5V operation. The Cypress PSoC parts will run at 5V...

Are they easy to solder?

It is reported that they're not as bad as they look, assuming you have a pretty high-quality PCB. Which is ok, given that they look awful, and high-quality PCBs are a lot easier to get than they used to be.

The real issue shows up when your program stops fitting in an ATmega328, or you need some modern peripheral like USB or Ethernet. Then you're pretty much stuck with SMT and 3.3V anyway, and you get to decide whether you're going to bite the bullet, or deal with module-level components (Pro Mini, Teensy, Maple Mini, etc, etc. All similarly priced.)

All that said, there is little reason to "retire" the 328 for those problems that don't stress it...

CrossRoads:
The PIC has some disadvantages - 3.3V output and only 10mA supply current, so of limited use for driving LEDs (could be limited to Red only), small motors, transistors, couldn't drive small telecom relays - so all the stuff that the '328P is good for in embedded projects without needing extra components.
More expensive - $3.15/100 vs vs $2.71/100 (digikey pricing)
Does have nice features for software projects, if you're into writing big software projects.

If I'd knew how to program those ARM processors, I'd dump Arduino IDE instantly. I seriously hate it sometimes, but there are no solutions as simple as it is (for Linux).

People have to deal with workarounds and removing features to deal with the low space Uno's and Nano's have. As soon as one wishes to use any networking, GPS or anything else other than simple led blinking.

Multiple SPI ports would be a godsend (no more bitbanged SPI!), 3V logic with 5V tolerance would be nice dealing with ESP alongside 5V LCD's.

Claiming that ARM chips are newbie hostile isn't a valid argument, you, smarter ones can make it as simple as programming ATmega328s. For beginners adding one more resistor and a transistor to blink a led would not be hard, would take a bit more space on a breadboard, but seriously, we can handle it. A lot worse is to deal with logic level incompactibilities, bitbanging and memory and space limits later on.

The Teensy is a great product. Costs the same amount as a Pro Mini (in the Arduino store) and has built-in USB,
(the picture from the product page)

Microcontroller MK20DX256VLH7
Operating Voltage 3.3V
Input Voltage (limit) 5V
Digital I/O Pins 34
PWM Digital I/O Pins 12
Analog Input Pins 21
Analog Output Pins 1
Flash Memory 256 KB
SRAM 64 KB
EEPROM 2
Clock Speed 72 MHz

It also has 2 SPI ports. And the emulation for the AVR is amazing.
There is also CAN bus functionality.

Avamander:
People have to deal with workarounds and removing features to deal with the low space Uno's and Nano's have. As soon as one wishes to use any networking, GPS or anything else other than simple led blinking.

That would be cool for an info Web site:

Which board is right for you?

Question #1:
Do you want to
(a) just blink an LED
or
(b) do more than just blink an LED?

I don't understand why Atmel does not release a 48 pin native USB based ADC/DAC included DIP packed ARM. Question is not who will buy. Who buy AVR? We.
When they released AVR who were their target customers? All these does not matter. Initially that might be a little problem but they will find intended customers at the end.
If an ARM like this comes into the open market we can think about UNO R3 ARM. At least we will be able to soil our hands with ARM development process with no or little effort.
Things will be a lot easy.

Just now I found an ARM LPC1114 DIP packed IC. Just google 'arm in dip package'.
It application has been mentioned here.
Now our Arduino can create an ARM board based on this IC.
One question, Can I create a JTAG or alike programmer with UNO R3 board? Can I create a usbasp like ARM programmer? I would not mind using gcc-arm.

When they released AVR who were their target customers?

Professionals and only professionals.

You, like me, represent a very very small percentage of Atmel customers and it is happy for Atmel.
Our opinion has no weight compared to that of professionals

Professionals refuse DIP: too big, too long to assemble.
In total cost of a product percentage of pcb area is very important so packages have to be smaller as possible.

Currently professionals prefer SMD and BGA.
Tomorrow they will use only chip on board (COB) or Wafer Size Package.

You'll have to admit that it will be increasingly difficult to make our board ourselves and we will have to content ourselves to assemble manufactured modules.

Regarding the ATmega328 IMHO it is still usable for many years.
The real question is: "How long Atmel will maintain production lines etching 90nm".
IMHO the answer will not be technical but financial.

You'll have to admit that it will be increasingly difficult to make our board ourselves and we will have to content ourselves to assemble manufactured modules.

Yes, we are already doing this. We cannot make our own motherboards. It will be too difficult to assemble a large circuitry. We are also buying modules BMP, motion analyzer like this one, or Wi-Fi like this etc are examples.
But for a small custom circuit their production method is not feasible. Their method is suitable for a commonly and widely used products like our arduino boards, sensors, computer SMPS, motherboards, mobile phones, TV set, washing machines, automobile electronics, calculators etc, not for a custom solution.
Also there is a prototyping stage in every manufacturing process. Oh! I forgot to tell a little story, what about schools and colleges? So DIP is not going to be obsolete. But it will be limited within a few types of usages and the price will be prohibitively high.

Regarding the ATmega328 IMHO it is still usable for many years.
The real question is: "How long Atmel will maintain production lines etching 90nm".
IMHO the answer will not be technical but financial.

But Atmel is still manufacturing ATMEGA328 because there are other customers who buy 328. And NXP has released their DIP packaged ARM LPC1114. All we need a USB-TTL converter, find a description. We can make our own USB-TTL if we hate to buy it. There are AVR-CDC, V-USB based on existing AVRs. Many China manufacturers are shipping cheap Chinese SMD versions of AVR-CDC here in India. These are cheap and small. So we can start our ARM Arduino with NXP even if Atmel stops the DIP AVR production line.
And why not use LPC1114? Its all
50 MHz
32KB Flash
8KB SRAM
SPI
I2C
USART
10-bit ADC
1×16-bit timer
2×32-bit timers
Cortex M0+
Best part its 1 USD. We expect at least at 1.6-1.8 USD when it will reach the local market. Atmega is still much above 2 USD. I bought an ATMEGA328-PU from an old stock rack from a local shop for 150 Indian Rupees (nearly 2.5 USD).
If we wish we can get into ARM and DIP at the same time. I expect our next Arduino UNO R3 ARM now.
Yes a lot of trouble is waiting there. We have to add a new tool-chain GCC-ARM plus we will have to configure our IDE so that it can compile ihex for ARM via GCC-ARM from Arduino C++ ino codes.
But it is possible if we wish.