AVRs or PICs

Thread Starter

shakilabanu

Joined Jul 8, 2014
44
Hi All,

I am a PIC micro user and have used PICs for years now. However, I am putting togather a new microcontroller training program and was wondering should I go PIC or AVR - considering the popularity of AVRs because of Arduino. Which of these might make for a better start off microcontroller at this point in time.
 

sirch2

Joined Jan 21, 2013
1,037
Let battle commence!

Seriously though, presumably you are putting together this training program with an purpose in mind so you need to consider what best fits your learning objectives and your target audience.
 

MrChips

Joined Oct 2, 2009
30,824
Let battle commence!
Seriously, what are you trying to teach? Are you focusing on:

1) Programming in ASM
2) programming in C
3) MCU architecture
4) embedded systems design
5) SW/HW project design and integration

Why limit your choices to PIC and Atmel?
What about Freescale, Silicon Labs, TI?
What IDE platform are you planning on using?

My choice would be MSP430 Launchpad.
 

ErnieM

Joined Apr 24, 2011
8,377
Definitely AVR 100%, final answer.

You will be doing your students a great service to be teaching them on a platform you have no experience with, where you are as clueless as they are. It is best you all stumble along together to find those subtle little things that can derail a project fast.

Oh, I'm only kidding. LDO.
 

NorthGuy

Joined Jun 28, 2014
611
People are waiting for 8-bit MCUs to get extinct, but, for unknown reasons, this doesn't happen and 8-bit MCUs prosper and even grow. If you coninue teaching them to new students, they will never get extinct!!!
 

MrChips

Joined Oct 2, 2009
30,824
Actually, I love AVR ASM. Just have to get accustomed to the reverse DST <- SRC notation.

I had migrated from 6805->68HC11->AVR with ease.
 

nsaspook

Joined Aug 27, 2009
13,315
People are waiting for 8-bit MCUs to get extinct, but, for unknown reasons, this doesn't happen and 8-bit MCUs prosper and even grow. If you coninue teaching them to new students, they will never get extinct!!!
8-bit chips will be around forever because engineers and hardware types love them and programmers don't.

Once upon a time, in a kingdom not far from here, a king summoned two
of his advisors for a test. He showed them both a shiny metal box with
two slots in the top, a control knob, and a lever. "What do you think
this is?"

One advisor, an engineer, answered first. "It is a toaster," he said.
The king asked, "How would you design an embedded computer for it?"
The engineer replied, "Using a eight-bit microcontroller, I would write
a simple program that reads the darkness knob and quantizes its
position to one of 16 shades of darkness, from snow white to coal
black. The program would use that darkness level as the index to a
16-element table of initial timer values. Then it would turn on the
heating elements and start the timer with the initial value selected
from the table. At the end of the time delay, it would turn off the
heat and pop up the toast. Come back next week, and I'll show you a
working prototype."

The second advisor, a computer scientist, immediately recognized the
danger of such short-sighted thinking. He said, "Toasters don't just
turn bread into toast, they are also used to warm frozen waffles. What
you see before you is really a breakfast food cooker. As the subjects
of your kingdom become more sophisticated, they will demand more
capabilities. They will need a breakfast food cooker that can also
cook sausage, fry bacon, and make scrambled eggs. A toaster that only
makes toast will soon be obsolete. If we don't look to the future, we
will have to completely redesign the toaster in just a few years."

"With this in mind, we can formulate a more intelligent solution to
the problem. First, create a class of breakfast foods. Specialize this
class into subclasses: grains, pork, and poultry. The specialization
process should be repeated with grains divided into toast, muffins,
pancakes, and waffles; pork divided into sausage, links, and bacon;
and poultry divided into scrambled eggs, hard- boiled eggs, poached
eggs, fried eggs, and various omelet classes."

"The ham and cheese omelet class is worth special attention because it
must inherit characteristics from the pork, dairy, and poultry
classes. Thus, we see that the problem cannot be properly solved
without multiple inheritance. At run time, the program must create the
proper object and send a message to the object that says, 'Cook
yourself.' The semantics of this message depend, of course, on the
kind of object, so they have a different meaning to a piece of toast
than to scrambled eggs."

"Reviewing the process so far, we see that the analysis phase has
revealed that the primary requirement is to cook any kind of breakfast
food. In the design phase, we have discovered some derived
requirements. Specifically, we need an object-oriented language with
multiple inheritance. Of course, users don't want the eggs to get cold
while the bacon is frying, so concurrent processing is required, too."

"We must not forget the user interface. The lever that lowers the food
lacks versatility, and the darkness knob is confusing. Users won't buy
the product unless it has a user-friendly, graphical interface. When
the breakfast cooker is plugged in, users should see a cowboy boot on
the screen. Users click on it, and the message 'Booting UNIX v.8.3'
appears on the screen. (UNIX 8.3 should be out by the time the product
gets to the market.) Users can pull down a menu and click on the foods
they want to cook."

"Having made the wise decision of specifying the software first in the
design phase, all that remains is to pick an adequate hardware
platform for the implementation phase. An Intel 80386 with 8MB of
memory, a 30MB hard disk, and a VGA monitor should be sufficient. If
you select a multitasking, object oriented language that supports
multiple inheritance and has a built-in GUI, writing the program will
be a snap. (Imagine the difficulty we would have had if we had
foolishly allowed a hardware-first design strategy to lock us into a
eight-bit microcontroller!)."

The king wisely had the computer scientist beheaded, and they all
lived happily ever after.
 

shteii01

Joined Feb 19, 2010
4,644
I had an idea for a little project recently. So I started looking for uC for it. Here is the thing... I want a native/hardware USB support. Guess what? PICs have it (16F and 18F PICs showed up in Microchip tool that helps you select a chip with features you want), AVR mostly don't (the ones that have it are not DIP packages so I would not be able to put it into breadboard and play with it).

The other news is that PICs don't have good free C compiler. AVR do (avr-gcc).

So my choices at this point:
* PIC and MPLab and do it in assembly.
* AVR and AVR-GCC and do software USB using V-USB.
 

ErnieM

Joined Apr 24, 2011
8,377
The other news is that PICs don't have good free C compiler.
Nope, Microchip gives away baseline C compilers free for the download. They also give away sample USB library projects in C that can be used as a running start for many USB applications.
 

josip

Joined Mar 6, 2014
67
So my choices at this point:
* PIC and MPLab and do it in assembly.
* AVR and AVR-GCC and do software USB using V-USB.
There are many companies with USB micros, with open source USB stack. For example, TI give you also your USB PID for free...

VIDs are assigned by the USB Implementers Forum (USB-IF), which is the standards body that oversees USB. The vendor can choose to obtain the VID by joining the USB-IF or to license a VID without joining. At the time of writing, the former costs $4000 annually, and the latter costs $3500 for a two-year license. (See http://www.usb.org/developers/vendor/ for more information.)

Alternatively, TI will license a PID to MSP430 customers for use with the MSP430 VID (0x2047) as part of its VID-sharing program. The license is free, with the basic stipulation that it only be used with TI USB devices. The program is intended to ensure that all MSP430 customers have easy access to a VID when going to market. To obtain a copy of the license, look for the link for this program at http://www.ti.com/msp430usb.
 

shteii01

Joined Feb 19, 2010
4,644
Nope, Microchip gives away baseline C compilers free for the download. They also give away sample USB library projects in C that can be used as a running start for many USB applications.
Yes. Baseline. Here is a quote from material that I found while doing a little bit of research:
"There is a free compiler for PIC available from Microchip, Dan Nguyen writes:

About the free PIC compiler, you just download it from the Microchip
website and you can use it in the Microchip MPLAB IDE. IT's actually
the student version and the only difference is that all features are
only enabled for the first week
. After that the only thing that changes
is you can only have the compiler "optimize" your code to level 2
instead of all the way- but most of the optimizations aren't needed at
all and if you like your code to run exactly how you typed it,
optimizations aren't for you.

Microchip says it doesn't update it as frequently as the paid version
(but that's understandable).


This is from 2012. The source of the quote: http://www.ladyada.net/library/picvsavr.html
 

ErnieM

Joined Apr 24, 2011
8,377
Yes. Baseline. Here is a quote from material that I found while doing a little bit of research:
"There is a free compiler for PIC available from Microchip, Dan Nguyen writes:

About the free PIC compiler, you just download it from the Microchip
website and you can use it in the Microchip MPLAB IDE. IT's actually
the student version and the only difference is that all features are
only enabled for the first week. After that the only thing that changes
is you can only have the compiler "optimize" your code to level 2
instead of all the way- but most of the optimizations aren't needed at
all and if you like your code to run exactly how you typed it,
optimizations aren't for you.

Microchip says it doesn't update it as frequently as the paid version
(but that's understandable).

This is from 2012. The source of the quote: http://www.ladyada.net/library/picvsavr.html
However, if you go to the source itself you'll fine the compilers "Free Edition includes a 60-day PRO evaluation that can be started anytime."

That is from 2014. In fact, 7/9/2014. That is today. The source of the quote.

One can get such C compilers for any device Microchip makes, from 10F to PIC32's.

At one time Microchip also gave away rights for device ID's too, I'm sure they still do if you look hard enough for the permission slip. Jan Axelrod also gives them away if you buy her book.
 

shteii01

Joined Feb 19, 2010
4,644
However, if you go to the source itself you'll fine the compilers "Free Edition includes a 60-day PRO evaluation that can be started anytime."

That is from 2014. In fact, 7/9/2014. That is today. The source of the quote.

One can get such C compilers for any device Microchip makes, from 10F to PIC32's.

At one time Microchip also gave away rights for device ID's too, I'm sure they still do if you look hard enough for the permission slip. Jan Axelrod also gives them away if you buy her book.
I was going to use assembly since MPLab provided full time full support, no need for evaluation periods and then loss of features once evaluation period has ended.

Ok. I am sorry for taking the thread on a tangent. I want to thank josip and ErnieM for the insights. I think I said everything I want to say on the OP topic so I will shut my pie hole and read what others have to contribute to OP topic.
 

Thread Starter

shakilabanu

Joined Jul 8, 2014
44
Let battle commence!

Seriously though, presumably you are putting together this training program with an purpose in mind so you need to consider what best fits your learning objectives and your target audience.
You make it sound like a Pepsi Vs Coke or a Canon Vs Nikon thing... not sure if that is the case already.

The only thing on the mind is will we see a shift of hobby people from PIC to AVR in a significant way in the next few years... I know that both these are fairly similar in terms of what they can do.
 

Thread Starter

shakilabanu

Joined Jul 8, 2014
44
People are waiting for 8-bit MCUs to get extinct, but, for unknown reasons, this doesn't happen and 8-bit MCUs prosper and even grow. If you coninue teaching them to new students, they will never get extinct!!!
Other people have answered this...but I am also of the opinion that they wont be extinct in the foreseeable future... so I guess I am safe there.
 

Thread Starter

shakilabanu

Joined Jul 8, 2014
44
Seriously, what are you trying to teach? Are you focusing on:

1) Programming in ASM
2) programming in C
3) MCU architecture
4) embedded systems design
5) SW/HW project design and integration

Why limit your choices to PIC and Atmel?
What about Freescale, Silicon Labs, TI?
What IDE platform are you planning on using?

My choice would be MSP430 Launchpad.
The program is start of program into embedded systems, and will mostly touch upon everything you have mentioned. Not the ASM programming though.

Limited to PIC and AVR because of local availability and similar local reasons.

IDE not yet decided on that, and it is one of the decision points too.

Wanted to get a feel of the mood about AVRs and PICs and looks like arduino hasnt helped the AVRs as much as I had assumed.
 

Thread Starter

shakilabanu

Joined Jul 8, 2014
44
I had an idea for a little project recently. So I started looking for uC for it. Here is the thing... I want a native/hardware USB support. Guess what? PICs have it (16F and 18F PICs showed up in Microchip tool that helps you select a chip with features you want), AVR mostly don't (the ones that have it are not DIP packages so I would not be able to put it into breadboard and play with it).

The other news is that PICs don't have good free C compiler. AVR do (avr-gcc).

So my choices at this point:
* PIC and MPLab and do it in assembly.
* AVR and AVR-GCC and do software USB using V-USB.
Thanks for that, but is AVR-GCC actively maintained? I did look at it briefly and got an impression that it not maintained anymore.
 
Top