AVR vs. PIC

I’m looking for an easy to use and program microcontroller for general projects. I have done some robotic projects with a BASIC STAMP 2, some IR emmitters and detectors, and continous rotation servos.

Could someone please make a case for one or the other? Using BASIC to program would be very nice. And having lots of other people using it would be nice to so I could find example code and other resources. Thanks for your help.

BascomAVR can’t be beat for quick and dirty projects.

http://www.mcselec.com/bascom-avr.htm

This argument has been done. And done and done and done and done. And here’s the result:

  1. Pick one.

  2. Use it.

Mike

I also started out with Basic stamps and outgrew them pretty quickly.

I don’t think you’ll have a problem finding resources for example code, for either PIC or AVR, but you should expect that most sample code out there for both of these chips will be in either C or assembly.

Both Microchip and Atmel offer free IDE’s that support Assembly out of the box, but other languages will require a compiler.

Personally, I choose AVR because the GCC compiler was available for it, both on Linux and Windows platforms, and seems to work very well. This is a C compiler (which I prefer greatly over basic for a lot of reasons), and its 100% free.

There were other differences that are of more interest to someone who might work in assembly or write a compiler. AVR’s hava a flat memory model, many more general purpose registers, 1 cycle average per (machine) instruction, compared to 4 for most PICs. Although you can stay blissfully unware of these things if you work strictly in a higher-level language, they definately do affect performance. These were also things that pushed me toward AVR.

I’ve heard nothing but good things about Bascom AVR, but I couldn’t tell you much about it. It does appear to be much more sophisticated and flexible than stamp basic.

Started out with BASCOM AVR, and it’s great if you want to get something up and running straight away. I also use GCC-AVR for most of my stuff.

Additionally, a programming cable for the AVR is 5 wires from your parallel port. I built one for about $3 and it’s still working fine after 3 years. Good programming software (AVRDUDE) is included with GCC-AVR and there’s a gui front end for it on sourceforge.

PICs are what they are. They are cheap, they are plentiful, and you can probably find any array of hardware that you need in their hundreds of configurations. Now, what PIC’s aren’t are clock efficient.

If you’re just starting out (no history with either) and planning on programming in something other than assembly (As you are, BASIC), I’ll have to agree with the above and say AVR’s are the way to go. If you werew plan to do a lot of assembly programming, PIC’s are far simpler. There is a free student edition C compiler now for 18F series PICs, but that’s just muddying the waters.

or u could go try the dsPIC, :D…

i am also starting out with microcontrollers and had kind of assumed i’d use a PIC, but the pro-AVR’ers above have given me pause.

is there a webpage that discusses the tradeoffs between the two? i’d be interested in everything from architecture (discussed briefly in an above post) to the available IDEs/compilers.

i’m not looking to stoke a flame war, just trying to get some criteria together to make a good decision.

to answer my own question, there was a reasonably good discussion on this in april 2004 on the PICList.

go to:

http://www.piclist.com/techref/postbot.asp

and search for “%pic%avr%” (no quotes) in the “Quick Search (subject only)” section. Scroll down on the right frame. The “PIC vs AVR” threads are worth reading.

Another link (perhaps dated and seems AVR biased):

http://www.dvanhorn.org/Micros/Avr/AVR_VS_PIC.php

That first link didn’t work for me.

I went with the PIC, because there seemed more info on the net dealing with it, so I figured it would be a good starting place.

On the second document, a few comments from my limited experience with the PIC:

  1. The interrput model on the PIC is indeed somewhat weak. However, I don’t really use all that many different types simultaneously.

  2. On security, PICs can indeed be erased after being locked.

Each have limitations, so I don’t think anyone is significantly better. The PIC’s memory pages are somewhat of a pain, but less so on the PIC18 (or does it even do pages?)

If you have some specific project in mind, try googling for it and see of someone has code or something for one architecture (at least to learn from.)

Grrr… timeout errors, I was going to comment on the second article myself with annotations, but the BB’s not allowing me to post more than a sentence or 2.

Norman:
That first link didn’t work for me.

ugh. i was afraid of that. you can go to http://www.piclist.com and click on PICList Mailing list archive and get to the page i originally posted.