Go Down

Topic: Differences between AVR & ARM (Read 3768 times) previous topic - next topic

Macnerd

I'm an electronics newbie.

I'm totally confused. Using Google I've tried to find out the differences between AVR architecture & ARM architecture. Google hasn't been much help. I know that I can get 32-bit AVR or 32-bit ARM.

I want to get an Arduino but there are so many different ones that it's hard for me to choose which one. I went to the Atmel website & looked around & it didn't help answer my questions. Does Arduino use only AVR? Does Arduino have any 32-bit Atmel micro-controllers? Is ARM used in the likes of Raspberry Pi & Beaglebone?

Please explain in layman's terms the differences between AVR & ARM.


rogerClark

I'm not sure what use comparing CPU architecture is going to be. The line is very blurred between all these devices.
i.e the Arduino Due as an ARM board.

You'd be better off letting us know roughly what you want to achieve and people can probably direct you to the appropriate microcontroller.

However in terms of the Raspberry PI, the key difference is the RPI doesn't have a lot of Input / Output capabilities. It just has a few GPIO lines which are 3.3V and can't drive much current. To interface the RPI to realworld hardware, people often connect an Arduino based daughter board.

BeageBone Black is a bit different, it has the speed and ram of the RPI, but does have the hardware interfaces. But is far more expensive (i.e 4 or 5 times the price).

If physical size is an issue to you, there are key differences between Arduino class boards and the RPI and BBB.
i.e you can get an Arduino Micro board which measures 32mm x 18mm with virtually full Arduino functionality, where as the RPI and BBB are around 10 times larger.


But, please post your requirements.
Freelance developer and IT consultant
www.rogerclark.net

Grumpy_Mike

#2
Jun 09, 2014, 05:20 am Last Edit: Jun 09, 2014, 05:22 am by Grumpy_Mike Reason: 1
As a self confessed newbie these issues will not matter to you at this stage. It will be a long time before the differences matter.

The important question is what do you want to do with the board.
Real time - choose an arduino
Linux - choose a raspbery or arduino Yun

Quote
Is ARM used in the likes of Raspberry Pi & Beaglebone?

Yes.

The main differences are in the sort of machine code instructions they have, but you will not be using that until you are well advanced.

MichaelMeissner


I'm an electronics newbie.

I'm totally confused. Using Google I've tried to find out the differences between AVR architecture & ARM architecture. Google hasn't been much help. I know that I can get 32-bit AVR or 32-bit ARM.

At the base level, an 8-bit AVR, a 32-bit AVR, and a 32-bit ARM are just chips that support a particular instruction set.  An instruction set is just ways to interpret the 0's and 1's in the program memory.  Think of it like human languages with no translators involved.  If you go to France, you must speak French to communicate effectively with people, if you go to Russia you must speak Russian.  This is an analogy, just to say that at the core level, the cpus are very different.

However, most people do not interact with the machine at the core binary level, they use a compiler (GCC in this case) to convert code to the binary form used by the chips.  GCC supports many different targets, you use an ARM GCC to compile code for ARM boxes, AVR 8-bit GCC for AVR 8-bit microprocessors, etc.  Above the compiler is the IDE (integrated development environment) that most people use to control the compiler.  Depending on the capabilities of the chip, you run a Linux environment instead of the Arduino environment.

When people talk about programming an Arduino, they could mean programming a board built by the Arduino company (Uno, Mega, etc.) or more commonly they mean using the Arduino libraries, IDE, etc.  for a particular platform.  The most common Arduino compatible platform is the 8-bit AVR processor using ATmega or ATtiny chips.

There are Arm chips that run the Arduino environment, including the Due by the Arduino company, the Teensy 3.0 and 3.1 by PJRC: http://www.pjrc.com/teensy/index.html, and the DigiX by Digistump: http://digistump.com/wiki/digix.  I have the Teensy 3.0, and it runs most Arduino programs as it, due to the tireless efforts of its creator Paul Stoffregen.  I also bought the DigiX during its kickstarter campaign, but so far I haven't powered it up.  The Teensy 3.0 is my main platform for coding these days.  As far as I know, nobody has come out with the 32-bit AVR in an Arduino platform.

If you need more computing power/memory/etc. you can go up to the Arm based Linux systems, such as the Rasberry Pi, Beagle Bone Black, pcDunio.  There you tend to be further away from devices, but you often times have a bigger picture on the environment.  You can combine the two, using a Linux computer for the brains, and network connectivity, and one or more boards running chips with the Arduino environment to do real time control.  There are some that are combined into a single board, and others that you buy as separate units, and then interconnect them.


I want to get an Arduino but there are so many different ones that it's hard for me to choose which one. I went to the Atmel website & looked around & it didn't help answer my questions. Does Arduino use only AVR? Does Arduino have any 32-bit Atmel micro-controllers? Is ARM used in the likes of Raspberry Pi & Beaglebone?


I recommend getting an Arduino Uno to people starting out.  The Uno is the default platform, and most things will run on the Uno.  There is a whole cottage industry of producing shields that sit on top of the Uno to provide extra functionality.  If you buy an official Arduino processor, it helps fund this site.  I would recommend for starting out, get an Uno and a starter kit that has a breadboard, wires, some LEDs, some simple sensors, etc.  Here is one starter kit that is made by Terry King who posts in these forums: http://yourduino.com/sunshop2/index.php?l=product_detail&p=244.

oric_dan

For a noobee, the ONLY thing that's important is ... The Learning Curve.

So, get something that's cheap and easy to learn how to use. First choice for this would be an Arduino UNO. First you need to figure out how to get to Square-1, then you'll know enough to worry about what to do after that.

rogerClark

Agreed.

Get a cheap Uno, there are plenty of clones on eBay I'm sure 99% of them are OK.

Then if it doesn't do what you want, or  it doesn't suit your project, you wont have wasted much money ;-)
Freelance developer and IT consultant
www.rogerclark.net

oric_dan


Agreed.

Get a cheap Uno, there are plenty of clones on eBay I'm sure 99% of them are OK.

Then if it doesn't do what you want, or  it doesn't suit your project, you wont have wasted much money ;-)

For that matter, a UNO may be the first board bought, but is unlikely to be the last. Once you get into embedded systems, you can always find a use for the older boards.

rogerClark

Quote
For that matter, a UNO may be the first board bought, but is unlikely to be the last. Once you get into embedded systems, you can always find a use for the older boards.


true.

I started with a Diecimila and now have various others. (but not the new expensive ones ;0)
Freelance developer and IT consultant
www.rogerclark.net

stevech

If  you haven't heard of it, Teensy 3.1 is the low cost way to add ARM processors to your expertise. The Teensy 3.1 board comes with Teensyduino which makes most of the AVR based code work, and there are library equivalents.
I have no financial ties to them.
www.pjrc.com and the great forum http://forum.pjrc.com/forum.php

rbright

I feel Macnerd's original question re ARM / AVR is quiet valid & not explained, sure different processor manufacturers may use different machine code but higher level sketch code does not notice any difference between ARM / AVR on different Arduinos or do they.

Today I downloaded a Nokia 5110 library from www.RinkyDinkElectronics.com & found a file structure in the zip as per attached image with seperate examples for ARM & AVR.

Why are their two types of examples, are really different ?? I've seen this with other librarys as well.

Looking forward to explanation


bobcousins

I feel Macnerd's original question re ARM / AVR is quiet valid & not explained, sure different processor manufacturers may use different machine code but higher level sketch code does not notice any difference between ARM / AVR on different Arduinos or do they.

Today I downloaded a Nokia 5110 library from www.RinkyDinkElectronics.com & found a file structure in the zip as per attached image with seperate examples for ARM & AVR.

Why are their two types of examples, are really different ?? I've seen this with other librarys as well.

Looking forward to explanation
In this specific case, it's because the AVR sketches use PROGMEM to store data. That's an AVR specific feature.

Probably the biggest difference that user will notice is code that uses on-chip peripherals. These always vary between manufacturers, and chip ranges.
Please don't PM me asking for help. Ask questions in the forum.

westfw


Quote
I know that I can get 32-bit AVR or 32-bit ARM.
Well, yes and no.  The 32bit AVR and 8bit AVR architectures are actually completely different from each other.  And Arduino doesn't run on 32bit AVRs.  So if you want to compare arduinos with AVRs (Uno, Nano, Leonardo) and Arduinos with ARMs (Due, Zero, Teensy), the big difference IS that the AVR is an 8-bit architecture, and the ARM is a 32 bit architecture.

The other major difference is that ARM is a general purpose computer architecture that has versions for multi-core multi-GHz machines, that has been "somewhat adapted" to work in "microcontroller" applications, while the AVR8 architecture was designed from the beginning as a microcontroller.  This has "interesting" consequences: in general an AVR8 can set, clear, or test some IO pin is as little as one 16-bit instruction, while an ARM probably takes at least three instructions and one 32bit dataword (but ... it's more complicated than that, especially if you stick the Arduino libraries in the middle.)

From a practical point of view, ARMs tend to have significantly more memory, run at higher clock rates, and have more complex peripherals.  AVRs run over a wider voltage range and have higher current drive.



Go Up