Advantages of Arduino Uno over PIC18F4550

The subject says everything. What is the difference of arduino uno and pic18F4550? in what ways does arduino uno is better than pic18f4550 microcontroller?

puffyqi:
The subject says everything. What is the difference of arduino uno and pic18F4550? in what ways does arduino uno is better than pic18f4550 microcontroller?

The Force is stronger in Arduinos.

Well for one thing the PIC is a chip, the Uno is a complete circuit board with power supply, IO headers etc.


Rob

C++ and AVR-GCC.

There is free a C compiler for PIC18 but it doesn't do any sort of optimisation and it is very strict in how it likes you to write code - if you want a compiler which optimises the code you have to pay Microchip many hundreds of pounds. The one thing I have found when working with PICs is that there software is so intermittent in whether or not it works.

The AVR also has better (well more useful) hardware timers (PWM, counters, interrupts etc).

And you get this friendly community as a resource to help you out.

And many many library's where others have done all the hard work for you for free

The AVR also has better (well more useful) hardware timers (PWM, counters, interrupts etc).

Hardware wise the two chips aren't that different. The real difference is having GCC on one side vs one-C-dialect-per-(costly)-compiler on the other.

IIRC there's an arduino-like board which uses PIC mcus. Don't know what development environment / compiler they require though.

There's a board called the "USB Bit-whacker" that is very close to the Arduino in concept. Plugs into USB and has a bootloader for downloading code.

Arduino has the high-quality C/C++ compiler, and the simplified IDE, and targets a different audience.

I wonder - does the Arduino/avr compiler do optimizations?

Also, I've used Microchip free MPLAB and the free C compiler for the PIC24 chips, and MPLAB
is much more difficult to get setup properly than the Arduino IDE, and sometimes you go around
in circles trying to figure out certain things, like how the darn directories and path connections
work. Much higher learning curve.

Also, with MPLAB you usually need a chip programmer like the PICKIT2, whereas Arduinos all
come pre-programmed with bootloaders so you don't need a programmer.

Also, with Arduino, you have many functions, like I2C, SPI, Serial, on and on, already written,
whereas you have to do all that stuff yourself for PICs. There are some libraries for the PICs
around, but I found them to be almost inscrutable to try and use.

To put it into historical perspective, Arduinos are as easy to use as the original Parallax Basic
Stamps, whereas using PICs is more like buying the raw chips Parallax used to make the
Stamps, and you pretty much have to do everything yourself.

I started playing with micro controllers about one year ago. I originally planned to buy a couple of pic chips. Until I took a good look at the software/libraries available and compared it to Arduino. The learning curve for pics is a lot steeper. I'm sticking to Arduino/AVR, if you outgrow the Arduino IDE you can always use your favourite editor and use gcc-avr to compile your programs.
This very forum also played a big role. I know there is always someone willing to help when I get stuck. I have learned a lot just by reading the programming section.

I wonder - does the Arduino/avr compiler do optimizations?

The arduino platform just uses an AVR adapted GNU GCC open source compiler which is an independent open souce group/project, and yes it offers several levels of optimization.

http://gcc.gnu.org/

Lefty

I shouldn't think GCC itself would have many optimizations, as those are usually added on
for the specific chip architectures the compiler is running on. So maybe the AVR GCC people
added them on.

I believe the Microchip C compilers are also based upon GCC, so they give away the non-optimized
versions, but they charge a lot for the versions they optimized in house for their own chips. But
this may all be scuttle-butt too.

All in all, however, for most applications, I doubt that most people really need to worry about this.

I'm sticking to Arduino/AVR, if you outgrow the Arduino IDE you can always use your favourite editor and use gcc-avr to compile your programs.

The other thing about Arduino is, there is an easy pathway when you need more processing power,
with boards like the DUE and misc 3rd party boards that use 32-bit processors, but which still use
the Arduino environment.

I believe the Microchip C compilers are also based upon GCC,

This is interesting. Do you have any links ? Thanks.

oric_dan(333):
I wonder - does the Arduino/avr compiler do optimizations?

Yes.

(Take a look at some disassembled output if you don't believe me...)

tuxduino:

I believe the Microchip C compilers are also based upon GCC,

This is interesting. Do you have any links ? Thanks.

This page says "GNU-based, open source code (except PIC18)".

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en536656

CrossRoads:
And you get this friendly community as a resource to help you out.

I don't think you can overstate how useful that is, especially for those wading into hobby electronics with microcontrollers for the first time. The scale of the community, and the associated mass of tutorials & libraries & instructables & online/printed support documentation has been crucial to me. Hard to believe 13 months ago I didn't even know the name Arduino - the community leg-up is the difference.

Having said that, it's probably not the best place to get an unbiased and balanced response to the OP's question :slight_smile:
Geoff

The PIC24, PIC30, PIC33 (all 16bit cpus) use a gcc-based compiler.
The PIC32 (32bit MIPS-core cpu) uses a gcc-based compiler. (and has an Arduino-like board and environment available in the form of the "ChipKit" products.)
Both of those can use free C compilers that produce reasonably good code. The MIPS CPU in particular has been supported outside of the Microchip range for quite a long time; it would be difficult to get it to produce bad code.

The PIC10, PIC12, PIC16, and PIC18 8-bit CPUs use an entirely different compiler. The free version from Microchip, for these CPUs, rather than being code-size limited like many free compiler versions, instead turns off optimization. ALL optimization; examples of spectacularly bad code have been posted. (I don't understand it. Microchip has other examples of quite reasonable behavior (in particular, their IDE runs on Windows, Mac, and Linux.) I have heard (but not confirmed) that the free USB code that microchip provides does not fit in the target CPU when compiled with the free compiler, for example.

I shouldn't think GCC itself would have many optimizations

You would be wrong. Many things can be optimized well above the specifics of code generation for any particular CPU. And I gather that one of the strengths of gcc is that they have implemented an abstraction of a cpu that makes it easy to add new CPUs and "instantly" get reasonable code. (In this case it doesn't matter much, because the 8-bit PIC architecture is SO far NOT compatible with that abstraction, and (essentially) could not possible be supported by gcc at all.)

Has anyone tried using an Arduino to program a PIC microchip?

It looks like you did no research before adding your question to this topic.

There are some current Topics on this subject including one in this Microcontrollers section.

...R