# 8051 ,PIC ,AVR ?????

Status
Not open for further replies.

#### ojer25

##### Junior Member level 1
pic avr 8051 comparison

WHAT the difference
WHAT THE BEST ONE
what are easeist one to learn end programme :?:

#### hill

##### Full Member level 5
compare avr and 8051

If you're choosing a uC to start, I would say PIC. The development tools are excellent and low cost.

#### C-Man

##### Advanced Member level 4
comparison of 8051 and avr core

This has already been discussed for example here:
h**p://

best regards

#### samcheetah

##### Advanced Member level 2
avr osp ii download

avr is faster than pic by 4 times.
8051 is faster than avr by 25 times. (Cygnal)

"FAST" is usually not the criterion in designing control systems. most of the time the microcontroller is wasting clock cycles or is waiting for something to happen. u know microcontrollers are not Intel or AMD chips that have to run an inefficient OS like windows

i would say that u start off from PICs. why?? because ive started with PICs too. but this is a clear matter of choice. it all depends on u. asking people which to chose between 8051, AVR and PIC wont help. ive seen these discussions becoming quite "religious". both the fans of PIC and AVR have a lot to say against each other. and then the 8051 has an even greater number of fans because it is usually the first thing alot of people start learning with.

if u want to start with PICs like me, go to https://www.winpicprog.co.uk there is everything there. programmer hardware, programmer software, and great tutorials.

i wish u good luck

#### ME

##### Advanced Member level 4
best among avr, pic and 8051 uc

hill said:
If you're choosing a uC to start, I would say PIC. The development tools are excellent and low cost.
The tools for AVR are better and cheaper. You can even get a free GNU C compiler for AVR.
Devlopment tools like STK500 are also cheaper for AVR.

I started with PIC and have been using AVR later.
Personally I would recommend to start with AVR's rather than PIC's.
AVR's have the best microcontroller forum for any microcontroller:
www.avrfreaks.com
If you are going to program in C I would definately choose AVR.
The quality and price of AVR C compilers are much better than for PIC, probably because the AVR was designed to be C friendly to begin with (The AVR architecture is much never than the old 8051 and the PIC.
The PIC was never ment to be used with C when it was designed.

8051 is a very old MCU but still very popular because it's very cheap and you can choose between a lot of different vendors. I think all the Intel patents for the 8051 has run out because it's so old. This makes ii easier and cheaper for other vendores to use this architecture instead of paying royalties for another architeture.
PIC and AVR are only made by one vendor.

But you could start with either PIC, AVR or 8051, they are all very common. The most important thing is to use a Flash based microcontroller so you can reprogram it very fast and many times.

Especially for c programming I would choose AVR.

TI has also made a new and very popular MCU family calle MSP430 competing in the same range as AVR and similar.
But the MSP430 can only run at voltages below 3.6V and I don't think you can get the in leaded DIP packages, but only SMD.

#### samcheetah

##### Advanced Member level 2
8051 pic avr

The tools for AVR are better and cheaper. You can even get a free GNU C compiler for AVR.

Especially for c programming I would choose AVR.

The AVR architecture is much never than the old 8051 and the PIC.
The PIC was never ment to be used with C when it was designed

true, very true! but u can also get a free C compiler for PICs, from HiTech. i think its called PICC or something like that. and the 18F series of PIC microcontrollers have a C-optimized instruction set. its also true that the PIC wasnt meant to be used with C. but now it is!!!!!

anyway i cant compare PICs and AVRs. because i havent used AVRs much. ive just done a bit of playing with them. and as i said that chosing between AVRs and PICs is a matter of choice.

#### ME

##### Advanced Member level 4
samcheetah said:
The tools for AVR are better and cheaper. You can even get a free GNU C compiler for AVR.
true, very true! but u can also get a free C compiler for PICs, from HiTech. i think its called PICC or something like that. and the 18F series of PIC microcontrollers have a C-optimized instruction set. its also true that the PIC wasnt meant to be used with C. but now it is!!!!!
The Hitech PICC compiler is not free, it costs no less than $950 and only works for PIC 12/14/16/17 Series! You can buy a similar compiler for the PIC18 series, it's called PICC-18 and also costs$950!

So if you want a Hitech compiler for both PIC12 or PIC16 and PIC18 series you have pay \$1900!

The free version is you think of called PICC-Lite and it only supports few of the PIC16 devices and the code is limited to 1k. So you can't use this with any of the new improved PIC18 devices which you mention.

CCS makes a cheaper C compiler for PIC, but it has a lot of bugs and new updates to correct the bugs are sometimes released 3 times per week.

I have used the CodeVision AVR C compiler which is somewhat similar to the CCS C compiler for PIC. But it has less bugs and is also cheaper.

But I don't think it's that important which MCU you start with.
If you use C programming you can quicly learn a new architecture and the C code is easy to port.
It didn't took me long to learn about the AVR when I switched from PIC, they are similar in many ways.
I takes a little time to learn how the special pheripehals of the different MCU families work, for example interrupt, timers and sleep modes.

If you use assembly it takes longer time to switch to a new architecture because you have to learn a new instruction set every time.

#### samcheetah

##### Advanced Member level 2
The free version is you think of called PICC-Lite and it only supports few of the PIC16 devices and the code is limited to 1k. So you can't use this with any of the new improved PIC18 devices which you mention

okay im sorry i didnt know this. actually i havent used C for PICs. im using assembly.

If you use C programming you can quicly learn a new architecture and the C code is easy to port

If you use assembly it takes longer time to switch to a new architecture because you have to learn a new instruction set every time.

okay thanx for the suggestions. i think now im going to consider using C for PICs. actually ive been wanting to do more playing with AVRs but its just a matter of time. then maybe ill be able to compare PICs and AVRs.

and hey btw ME how does that monster type thing know my IP address i mean your avatar

#### mhamed

##### Advanced Member level 4
I think 8051 is better than the other to get start.becuse its artichecture is so simple and its assembly very simple.
but PIC is CISC (i hope i am true) and CISC uc is not good to start learning uc.
Best Regards

#### samcheetah

##### Advanced Member level 2
but PIC is CISC (i hope i am true)

this is another point of controversy. while microchip calls PICs as RISC microcontrollers many people claim that PIC isnt RISC at all. its just that PICs have a very small instruction set, 35 instruction for the 16F devices and about 56 (if i remember correctly) instructions for the 18F devices.

some say that calling PICs RISC microcontrollers is just a marketting strategy. its just that PICs had a small instruction set in the first place and when the buzzword RISC came in the market microchip started calling PICs as RISC.

#### ojer25

##### Junior Member level 1
wow
i still confused................
some say go to PIC
and other say go to AVR
but nobody concern with speeeeeed
If I use 10MHz crystal ,I will get :
For pic 2.5 MIPS(mega instructions per sec )!?
For AVR 10 MIPS(mega instructions per sec )!?
For 8051 250 MIPS(mega instructions per sec )!?

#### emmos

##### Member level 2
hi everybody

don't be confused :wink:
concerning the speed u decide according to the application u r doing now
as in some applications speed is not the issue.

as for wish is best plz search in elektroda in this frum u will find several posts about this topic

as for me i use Atmel 8051 series and i thisnk i will soon begin in AVR as it will lead for the next years.

bye
Emmos

#### C-Man

##### Advanced Member level 4
ojer25 said:
wow
i still confused................
For 8051 250 MIPS(mega instructions per sec )!?

For "standard" 8051 you get 0.833333... MIPS for RD2 8051 you get 1.666... MIPS.

Standard 8051 divide the clock by 12, RD2 8051 by 12 or 6 and there are other derivates around that divide by 4.

best regards

#### jhonny_yang

##### Full Member level 2
What you want to do ?
if hobbies you can choose AVR , 8051 , PIC.

Manufacture using 8051 and PIC commonly.

If you personally use , you meet the confuse. If you for mass production choose PIC (priority) and 8051 for more larger one project

#### ME

##### Advanced Member level 4
jhonny_yang said:
What you want to do ?
if hobbies you can choose AVR , 8051 , PIC.

Manufacture using 8051 and PIC commonly.

If you personally use , you meet the confuse. If you for mass production choose PIC (priority) and 8051 for more larger one project
And why can't you use AVR for mass production and larger projects?
This is also common for commercial products. AVR is among the most sold 8-bit MCU's. 8051 is more sold, but ot if you only look at one 8051 vendor.
Noboy designs a MCU for hobby use only, there is no money in that.

ojer25 said:
wow
i still confused................
some say go to PIC
and other say go to AVR
but nobody concern with speeeeeed
If I use 10MHz crystal ,I will get :
For pic 2.5 MIPS(mega instructions per sec )!?
For AVR 10 MIPS(mega instructions per sec )!?
For 8051 250 MIPS(mega instructions per sec )!?

8051 is nowhere near 250 MIPS @ 10 MHz.
As mentioned earlier you have to divide the crystal frequency with 12 at a regular 8051.

Maxim/Dallas www.maxim.com and Silicon Laboratories www.silabs.com makes special and very fast pipelinde 8051 MCU's.
The fastests Silicon Laboratories 8051 MCU's performs up to 100 MIPS @ 100 MHz.
These two vendors are the ones that makes the fastest 8051 MCU's.
But they are alos quite expensive.
If you need a fast MCU

If you need a very fast 8-bit MCU I would reccomd an AVR, because this is cheaper than one of the special fast pipelined 8051 MCU's.

But often the speed isn't very important for 8-bit devices.
Power consumption is often very important for especially battery operated devices.
This can be complicated to compare directly. You have to consider different sleep modes and if the code is excecuted faster it can be longer time in sleep mode, and the code is smaller at some devices than other, which again makes the code run faster.
One MCU performing 1MIPS can be twice as fast as another MCU performing 1MIPS if the codesize to do the same is only half as big.

My experince is that the codesize at AVR in general is smaller than for the same program on PIC, on top of that the AVR can perom more MIPS.
The codesize might have decreased with the new PIC18 family which has more instructions than the PIC16.
But most times you don't need a MCU that can run faster than a standard 8051 or PIC.
Some MCU's need more instructions than other to perform the same task.

Both AVR and PIC have made new devices recently that uses less power.
I don't know how power economic 8051 is compared to AVR and PIC.
MSP430 has become famous for it's low power consumption.

Here is a benchmark comparison between PIC, AVR, MSP430 and the new MAXQ made by Maxim:
https://www.maxim-ic.com/appnotes.cfm/appnote_number/3221
The MAXQ 8- and 16-bit MCUs has not been released yet, but it looks promising.

#### manitooo

##### Full Member level 2
BTW : with those "High speed 8051" don't be disturb and try to compare what Is comparable :

because I can also say that PIC is 100 times faster or more than AVR if AVR is running on a 32.768Khz clk and PIC @ is maximum..

you should compare MCU with the same clk and compare their architecture which is more faster @ 15MHz for ones and not others...

For answering the topic : they are all good : they are all MCU and when you don't have any knowledge on MCU : all are interesting.

What you should consider when learning a MCU is

1. the way and facilities to get answer to you question
On the theme, I think that there are a lot of 8051 lovers, AVR lovers, PIC lovers and so on... among elektroda

2. Tools : compiler and programer. They are the more inportant I think because if it is for an work application : you can choose whatever you want because all the professional compilers and programmers are really affordable for a company... But if you want to learn MCU as a hobbit, you should take care of the prices for goodies...

AFAIK : all exept AVR have non free compiler or programmer.. AVR is the only basic MCU that can provide a full chain for FREE..
compiler : WINAVR
programmer hardware (see at lancos or in elektroda I think)
Programmer software : ponyprog, avrISP, AVR OSP, avrdude ...

I would appreciate if someone can complete the FREE tools list for other MCU (I mean : 8051, PIC, and all other you way have used)

CU
manitooo

#### jhonny_yang

##### Full Member level 2
easy ... PIC and 8051 have cloned by taiwan or china so the price is really2 cheaper , and AVR is not popular in china and taiwan so can't be cheap. Beside that in internet PIC and 8051 project is easy to get.

#### ME

##### Advanced Member level 4
I agree that the tools are probably more important than the devices themselves. Especially if you are not going to produce 100,000+ of the same device.

Remeber that you can't compare MIPS numbers directly.
Some instructions requires 1 one cycle, but other instructions requires for cycles.
The best way to compare two MCUs is to do some benchmarking.
Write your program to both MCUs and compare codesize, excecution time, power consumption etc.
If you write the program in a high level language like C, the compiler optimation will also come into play.
But the compiler is also part of the result in a finished product, so it doesn't matter that this affects the resuult, because it will also do this in a real application.

IAR makes compilers for almost all MCU families available, so the IAR compilers would be good to compare the MCU performance without too much influence of the compiler quality, since all the compilers would be from the sam company.

But one application might be better on one MCU, while another application will be better on another MCU as you can tell from the graphs in my last post.
This makes reliable benchmarking very complicated.
Maxim made the above benchmarking, so they have probably left out some of the benchmarking results out that made the MAXQ look bad.
I find it hard to trust benchmarking 100% from one of the involved companies, it has to be an independent benchmarking from a 3rd party.
But at least you use it to compare the other companies MCUs: PIC16, AVR and MSP430.

Remeber there is also a lot of other 8-bit MCU families than the one mentioned.
But for learning and hobby use I would choose AVR; PIC or 8051, because you can find a lot of sample code and support for these three devices on the net.
All three are good choices.

Here's a couple of good sites with forum etc. to start:
For AVR: www.avrfreaks.com
For 8051: www.8052.com

#### samcheetah

##### Advanced Member level 2
I would appreciate if someone can complete the FREE tools list for other MCU (I mean : 8051, PIC, and all other you way have used)

yes why not.

ive only used PICs so i can only talk about PICs

Free programming software ----- WinPicProg (https://www.winpicprog.co.uk)

Free programming hardware ------ Ozipic ( same link. u can download the schematics of Ozipic and etch a PCB and make the programmer yourself. The Ozipic programmer is actually a variation of the P16PRO40 hardware which in esscense is based on the original David Tait P16PRO hardware. this is the most simplest and the most fastest programmers for PICs. it uses the parallel port and only needs cheap components to build.)

Free Assembler ----- Good ol MPASM (included in MPLAB)

Free Samples ------ Microchip has been know to be better in providing free samples. i havent heard much about AVRs been freely delivered to someone. altho there are some rare cases.

Free C compiler ----- HiTech PICC-Lite (as pointed out by ME, it supports only a few PICs of the 16F series)

now about using C for microcontrollers. if u are using the 14-bit core PICs i would suggest that u stick to assembly. thats because the the instruction set of the 14-bit core PICs isnt optimized for C. but feel free to use C for the 18F series devices.

actually i think that using C for microcontrollers is a good idea. its rightly said that a hundered lines of code of assembly equals one line of C (thats why C is used more for the x-86 processors). but when i was learning programming we were taught C and then C++ and we were told that C++ is better. well thats true in context of PCs. i really wish there is some way i could program microcontrollers in C++. does someone know about such a compiler? altho im good at C too, but i like C++ more[/quote]

#### SphinX

##### Advanced Member level 3
Salam,

C-Man Wrote

For "standard" 8051 you get 0.833333... MIPS for RD2 8051 you get 1.666... MIPS.

Standard 8051 divide the clock by 12, RD2 8051 by 12 or 6 and there are other derivates around that divide by 4.

Don't forgot DS89C420
The DS89C420 offers a maximum crystal speed of 33MHz, achieving execution rates up to 33 million instructions per second (MIPS).

https://www.maxim-ic.com/quick_view2.cfm?qv_pk=2963

SphinX

Status
Not open for further replies.