Personal comparison between PICs and AVRs

Thread Starter

mik3

Joined Feb 4, 2008
4,843
Many threats are opened to discuss this subject, PICs vs AVRs.

I have used both 8-bit PICs and AVRs and from personal tests I can say that AVRs are superior to PICs because they don't divide the clock by 4 while PICs do.

The test was a pin being driven high and low with no delay between the high and low instructions. Both uC were clocked at 8 MHz.

The AVR (ATMega8) pin was switching at 2 MHz. This is because the instructions (assembly) which were needed to perform this action needed 4 clock cycles to be executed (check ATMega8 datasheet for execution cycles).

The PIC (16F819) pin was switching at 500 kHz. The one reason is that the instructions needed 4 clock cycles (PIC16F819 datasheet) to be executed and the other is that the clock is divided by 4.

Thus, it is seen that AVRs are faster than PICs at the 8-bit level referring to their instruction execution cycle because for the same instructions (compared in the datasheets) both families need the same cycles per instruction and because AVR does not divide the clock.

AVRs have a larger instruction set than PICs ans thus they need less code to perform a task.However, most of the instructions (not included in the PICs instruction list) need more than one cycle to be executed and thus balances their total execution program speed comparing with PICs (if PICs didn't divide the clock and were like AVRs).

This doesn't mean they are not faster because if they had both the same instruction list AVR would be faster because it doesn't divide the clock by 4.

According the 16-bit and 32-bit versions, PICs don't divide the clock and I think they have the same program execution speed.
 

millwood

Joined Dec 31, 1969
0
that's a valid *performance* comparison to the extent that all you want to do with your mcu is to turn the ports on and off.

the further you move away from that, the less applicable such a comparison is.
 
If it's MIPs you want there are some very fast PICs available and are about the same price as some 16F PICs.

The 24H can hit 40MIPs kinda overkill for flasing an LED.
 

nanovate

Joined May 7, 2007
666
The 24H can hit 40MIPs kinda overkill for flasing an LED.
This is a 16-bit part with a different core and architecture than the PIC12/16 and PIC18. That part is better compared with the ATXMega series from Atmel which is 32 MIPS (has 8-bit core with 16-bit enhancements). BTW Silabs has a 100 MIPS 8051.
 
Another nice PIC feature is one inexpensive tool (PICkit 2) can program & debug almost all modern PICs.

All in all it's personal preference. It's like comparing apples to oranges.
 

hgmjr

Joined Jan 28, 2005
9,027
Among the most attractive features of the AVR series of microcontrollers for me is the free software development tools. The powerful full-featured IDE for assembly language development is called AVRSTUDIO4 and can be downloaded for free from www.atmel.com. The C-compiler add-in to the AVRSTUDIO4 IDE is called WINAVR and it can be downloaded for free from www.sourceforge.net.

These tools support code development in assembly language or C-language for almost all of the AVR microcontrollers.

hgmjr
 
Last edited:
PIC vs AVR debates are pointless and endless and has been discussed adnaseum on the web before. There is no right answer. You might as well start a debate on what's the best color.
 

Thread Starter

mik3

Joined Feb 4, 2008
4,843
The correct answer is that there is not a best family of microcontrollers. The most suitable choice depends on the application.
 

Metalfan1185

Joined Sep 12, 2008
170
Im sold on the AVR chips,

Cmon, $6 for an ATMega328 with a pre-installed bootloader, plus a free development IDE, and a great forum of pros that are geniuses when it comes to this stuff...


I use 2 Arduino's with 328 chips and they work extremely well. and learning C isn't as bad as i thought it was going to be.

I wanted to try a PIC because you can program them with BASIC but I dont have the cash for one. the few iv'e seen are pretty expensive (like, $120). And even so, if i could afford one, i could buy about 20 AVR chips for the same price!
 
The ancient 10F thru 16F do not have PLLs so they are stuck with a /4 clock. Their modern replacement the 18F have a 4x PLLs (and some have more complex PLL's like the USB PICs)
My favorite funky PLL is the one found in the 24HJ12GP20x

it has 3 stages.
/ 2 to 33
x 2 to 513
/ 2, 4 or 8

That's thousands of combinations.
 

millwood

Joined Dec 31, 1969
0
regardless of how they multiple up the pll, they all divid up the frequency by four to get to a system clock.

at least for the non-dspic types.
 

millwood

Joined Dec 31, 1969
0
comparisons of any mcus on "speed" alone are (almost?) always meaningless.

for the hobbyests, any mcu is typically too fast. how many mips does it take to blink an led? :)

many times, I chose mcus for irrational reasons: because it is fun to learn a new mcu, or I want to try out a new dev board, or a new IDE, etc.

very rarely, the speed is at or near the top of my list of reasons to use a mcu. to me, the programming environment and availability of user support / code base are far more important.

I am sure similar considerations exist for commercial developers, aside from corporate commitment / strategies / existing code base / etc.
 

nanovate

Joined May 7, 2007
666
I am sure similar considerations exist for commercial developers, aside from corporate commitment / strategies / existing code base / etc.
cost cost cost do not forget cost ;)

One good thing (or bad depending on your perspective) about Microchip is that they have not End-of-Life'd any of their PICs. So yes that OTP PIC16C54 from years ago is still available for purchase.
 

jp0304

Joined Mar 11, 2009
7
hi everybody,
I'm programming in BASIC Bascom (AVR) from nearly the first version. I did professional job with it : Pilot of HF generator for radar, and so on...
before I used PC104 for the same job!

I did it fast , easely and with an incredible good forum to assist me.
the upgrade of version are free of charge,
The AVR are very similar one to another. from the Tiny25 to the mega256

Funny, a friend of mine works with Pic OTP for small use but with AVR for large application.:)
I think it is very nice to have the both on the market;)
But my choice is done!

JP
 

Thread Starter

mik3

Joined Feb 4, 2008
4,843
I think it is very nice to have the both on the market;)
I agree with that because as I get involved more in microcontrollers I find out that each company offers different features for their microcontrollers and the choice is made upon the application. Also, I started this threat and said that AVR is faster than PIC because AVR does not divide the clock by 4. Now, I can say that this is true only for 8-bit microcontrollers. For more powerful microcontrollers the processing speed (MIPS) are more or less the same for both AVR and PIC.
 
Top