# AVR(or PIC) vs ARM for LoRaWAN nodes [closed]

Well, you can say that the title is a little bit misunderstanding. I do not want to compare these architectures, it's worthless.

I am trying to understand why an engineer could ever pick for his LoRaWAN node an ARM MCU. In my opinion, if someone trying to design a LoRaWAN gateway then an ARM MCU is a good/safe option. But if you want to design an ultrasonic sensor, an air quality sensor or a magnetic sensor, i can not find any benefits on using ARM MCU.

In my designs, i have done tests using 8-bit PIC (pic18lf46k22) and AVR (atmega328p) and i can say that on the above applications these MCUs are overspec!

So, the only thing left was the cost of the MCUs for making the "right" choice. Let's say at 100 pieces you can get an atmega328p at $0.98 per piece and for STM32F411RCT6 you need about$3.98.

My company is buying competitors products so we can check what they are using etc.

I have NEVER seen any other MCU architecture than ARM.

So this is really bad for me because i am thinking that i am missing something.

I really need advices/opinions from more experienced engineers than me.

*Reminder: * I consider as simple applications for me is to get data for one or two sensors and send them to the gateway.

P.S. We have a waste management project (40 sensors) running for 7 months and nothing "weird" happened. We are using atmega328p.

• I don't care about the architecture. I can not understand why to choose ARM MCU for simple applications when their cost is too high. I was asked the question because i am not sure if i am doing anything wrong and missing something. – alexisicte Jul 5 '18 at 10:17
• Your question really is "What are MCU selection criteria". The final application does not matter. Short: logistics, pricing, longevity. Not always "technical superiority". AVRs can be seen because of the Arduino libraries - companies often bang a prototype together using Arduinos and then think that they have a product. Nasty to work on it later on... – filo Jul 5 '18 at 10:17
• It depended on what you consider simple applications. – MaNyYaCk Jul 5 '18 at 10:21
• Keep in mind your competitors may have more leverage on pricing than you do. I have seen some of the pricing that Chinese companies get from US semiconductor makers (say on DSPs) when the dollars per part number get into the multiple millions and it looks nothing like what the Digikey 100 piece price looks like, believe me. The vendors want to move silicon and they will do it, if they can make a profit. – Spehro Pefhany Jul 5 '18 at 12:27
• Originally the popular LMiC LoRaWAN implementation when running with encryption would notoriously not fit within the constrained memory (IIRC, RAM) of an ATmega328. That may (?) have been fixed by greater optimization. But there are few remaining advantages to the older parts, especially when you have other parts in the system with more constrained voltage rating. There's a lot to be said for picking a family where you can economically extend to greater or lesser resource sizes without changing footprint as is common with ARM; an ATmega328 is about as far as you can go before a big jump. – Chris Stratton Jul 5 '18 at 15:10

If you product is working, then what is the problem? AVRs are very competent chips, with decent peripheral sets, low power consumption and generally good longevity. The main area they fall down against ARM is in raw processing power, but as you note, this isn't that important in your application. If it is working for you then I wouldn't bother changing it.

However, one point you are not correct about is cost. There are many manufacturers of ARM chips, and typically not much between them, so the market is very competitive. For example, you can get an STM32F030 for around 50c. It has a lot more power than your ATmega328p and if you need more processing power/peripherals/memory there is an entire drop in upgrade tree that you can swap in. The ATmega328p is not comparable to an STM32F411. The latter has 8x the flash memory and something like 10x the processing power. That it only costs 4x as much is actually quite a bargain.

As to why your competitors use ARM chips? More than likely because there is no reason to not use them and they have become industry standard in recent years. Processing power is cheap these days, and embedded programmers who can carefully optimise code are expensive. Especially if they are a startup, not being too constrained on resources is a good way to accelerate development.

• Many thanks for the reply. My main problem is the price. If i could get an STM32F030 for 50 cent there is nothing else to discuss. I will give it a try. – alexisicte Jul 5 '18 at 10:46
• Yeah that is what I would have said as well. We use the F051 and even in spec for 125 °C it costs just 75 cent. – Arsenal Jul 5 '18 at 11:05
• Not just compute; AVR is quite constrained in available memory sizes (at least before changing footprint) unlike most ARM families. Also peripherals tend to be fewer and more limited. – Chris Stratton Jul 5 '18 at 15:11
• What about the cost of the supporting circuitry? Is it more expensive for the M0 family? – nh43de Mar 18 '19 at 20:12

You are missing something here, namely the lowest-end ARM Cortex M0 chips. These cost around $1 too. Instead you compare old 8-bit MCUs with Cortex M4 STM32F4, which is a beast in comparison. The STM32F4 can run at 100MHz, with 512 kb flash, 128k RAM, tons of specialized peripherals, FPU etc etc. Of course it will be much more expensive! Rather, you should look at something like STM32F0 (or Atmel SAM, or whatever your favourite flavour of ARM is). The list price for the linked one is$0.73 @ 10k. And for that you get a MCU which can run laps around AVR or PIC in every single aspect.

The real question is why some people are still using 1980s architectures like AVR or PIC - that question I cannot answer.

• Indeed, I've done board designs that could accept either an STM32F0 or and STM32F4 on the same footprint. The STM32L0 series is also worth looking at. – Chris Stratton Jul 5 '18 at 15:13