Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

AVR vs 8051 vs PIC

Status
Not open for further replies.

Bluesbird

New Member
Could somebody please explain to be the basic differences and advantages/disadvantages of AVR, 8051, and PIC microcontrollers? A link to a website explaining in-depth this would be useful.

I'm about to undertake a project which will require a very simple microcontroller. I will have to design a circuit for the this and the other components to be made using a single-layer PCB. Ideally, the microcontroller should be reprogrammable in this circuit for prototyping. Low power consumption is important. I would like to be able to program it in C, although I also have experience in Assembler. The only microprocessor I have experience with is a Silicon Laboratories mixed-signal 8051 microcontroller, but I also have some experience programming FPGA and PLDs.

Based on this information, which type of microcontroller should I be looking to use in my project?

Thanks in advance for you help.
 
In my opinion PIC is easier compared to others. I have used 8051 previously, but its easier with a PIC. PICs are low power consumption devices and the good thing is u can select a wide range of PICs depending on the number of I/O pins and other features.
There are two versions of PICs One time programable version, and Flash version. So for your application you can select the Flash version.
 
The PIC is the most popular one, and they are cheap and reliable.

However, if you already have experience with the 8051, I would suggest it's probably better to stick with that - but if you have no experience, the PIC is the easiest to learn.
 
Marxmax said:
marxmax said:
PICs are low power consumption devices and the good thing is u can select a wide range of PICs depending on the number of I/O pins and other features.
That's true!
I'm currently working on 89S5x,but I still suggest that you try a PIC,since you are going to develope it in C.And I suggest that you take care to choose whether or not to use one with ICSP feather.If you don't mind connecting your MCU to your PCB via a header,and that you don't mind unpluging & pluging it back to upgrade,a flash type PIC without ICSP is cheap and enough for use,otherwise you will have to determine which type to use in a relatively smaller range.And don't forget to get an ICSP programer.
 
If cost is not a big factor stay with the Silicon Labs(SL) controllers. The SL controller is the fastest of the 3 and it has JTAG debug (a life-saver when it comes to firmware development) on all it's controllers. Only high end AVRs have JTAG debug and I don't think any PICs have it. As far as power consumption they will all be on the same order of magnitude. Your power consumption will depend a lot more on smart use of sleep modes than it will on controller architecture. If you need incredibly low power consumption you might be better off with Maxim's MaxQ or TI's MSP430.

SL also has easy instructions for using the free SDCC C compiler with their IDE.

A quick rundown on the 3:

8051: an old but very popular controller. The older 8051s are kinda slow: 12 clocks per instruction. Newer 8051s have 6 clocks per instruction up to 1 clock per instruction - make sure you know which because it really makes a difference. The 8051 is made by almost every company that makes microcontrollers which gives you a huge selection. The selection of low pin count devices is a bit limited. Most 8051s have an external memory bus that makes it easy to add memory and peripherals. CISC. Free C compiler.

PIC: Slightly less old than the 8051. I'm not a PIC person but my impression is that PICs really shine with their small low pin count devices. Small and very cheap with decent performance. Marketed as RISC but is more like a CISC processor with only a few instructions.

AVR: The newest architecture by about 20 years. Designed for a pipeline so has very good clocks/instruction. Many more registers than 8051 or PIC. Good range of devices: small and cheap to fairly high performance. Most RISC of the 3 which makes it the most C friendly. Free C compiler.
 
I'd disagree with the 'RISC' assessment - RISC stands for 'Reduced Instruction Set Chip' - as such the PIC is by FAR the most RISC device of the three, the AVR is more of a CISC with it's high number of commands.

Also, speed wise, the top end PIC's are a match for the top end AVR's, if you compare low end PIC's with top end AVR's, then obviously the AVR's are faster. But if you compare top end PIC's with low end AVR's, similarly the PIC's are far faster than the AVR's.

However, this isn't to say that RISC is a good thing or a bad thing!, nor that higher speed is always desirable - most microcontrollers will spend the vast majority of their time simply wasting time - probably well in excess of 99% spend in loops and waiting for something to happen.
 
Thanks for the rundown bmcculla. I think I will stick with the Silicon Labs microcontroller, as I have access to a development board and C compiler.
 
The Reduced in RISC means simpler not nessesarily fewer. The PIC violates a bunch of RISC rules. PIC is sort of half RISC half CISC. It folows some rules and violates others. The AVR is much better about following the rules even though it has more instructions.

https://en.wikipedia.org/wiki/RISC is a good definition of RISC computers.

Whether or not RISC is a good thing or even if there are any "real" RISC processors is almost impossible to answer because there are so many variables.
 
bmcculla said:
The Reduced in RISC means simpler not nessesarily fewer. The PIC violates a bunch of RISC rules. PIC is sort of half RISC half CISC. It folows some rules and violates others. The AVR is much better about following the rules even though it has more instructions.

I didn't see anything on that site that suggested that a PIC isn't as much a RISC processor (if not more so?) than an AVR?. There also aren't any 'rules' about being RISC or not, just suggestions - also bear in mind the PIC was a RISC processor years before the AVR came along - which was an obvious 'jump on the PIC bandwagon', even copying the three letter name!.
 
Wikipedia:
It was the small number of addressing modes and commands that resulted in the term Reduced Instruction Set. This is not an accurate terminology, as RISC designs often have huge command sets of their own. The real difference is the philosophy of doing everything in registers and loading and saving the data to and from them. This is why the design is more properly referred to as load-store. Over time the older design technique became known as Complex Instruction Set Computer, or CISC, although this was largely to give them a different name for comparison purposes.

This statement is the reason I think PIC doesn't fit as a "real" RISC processor. PIC uses indirect addressing which violates the cardinal principal of RISC - the load/store architecture.

I'm not trying to bash PICs. Microchip has some great products. The future holds interesting things for the PIC too. If I remember correctly Ubicom won a lawsuit to use the PIC architecture. They have a PIC with a better pipeline that gets 1 clock per instruction instead of 4. The lawsuit might make PIC an open standard like the 8051.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top