Confusion between Arduino and PIC, Which one is better for learning?

MrChips

Joined Oct 2, 2009
35,018
Agreed. Microchip PIC is a chip. Arduino is a system.

Personally, I prefer to use Atmel AVR over a Microchip PIC. The AVR was designed by people who understood what they were doing. It was also designed with C in mind and optimized for a C compiler. PIC was originally intended for hobbyists. Same goes for Arduino.
 

ErnieM

Joined Apr 24, 2011
8,415
Is Arduino easy to learn or PIC?
The Arduino is by far the easier one to learn. I've seen answers from lots of very opinionated people here and honestly I stopped reading them after the first page.

Look, any embedded project has a lot of little pieces that all need to play well together least you just build a brick.

Say you want to use a PIC to flash an LED. Honestly that is the level you want to begin at.

So you need some hardware. Something to hold the PIC, give it power, maybe a crystal so it runs at a good speed, a resistor, a LED, and some power. That all has to be right or nothing happens.

Then you need a program. Guess what? That also has to be right or nothing happens.

Finally you need a programmer. And if that isn't correctly installed and connected...

I spent a lot of time using PICs. I put them in a few products that I believe are still in production today. That was not an easy thing to do.

I've never used the Arduino, but I do use some single board computers (ESP8266 and ESP32) that use the Arduino IDE to write code and upload it to the device over USB. The ground work is all there so I can just write my application and drop the computer into my board. Made my job easy for something I wanted custom for my home.

Forget assembly language for now. C or even Basic is a better start until you get to think in code.

Do look for some educational package with lessons, a known good board and some parts to experiment with. You don't want to build an AI wonder, you want to learn how to flash a LED or sense a button press or read a potentiometer. Basic stuff.

Once back when Radio Shack was still around I picked up a learning package called "What's a Microcontroller?" that came with a Basic Stamp single board computer. You wrote your code on your PC, upload it to the stamp (I think over a serial cable but probably USB today) and watch things happen. That one had the stamp build a card with a solderless breadboard area.

It was kinda fun to work the examples, I learned some things, some good, some bad, and eventually put the whole thing away and went onto bigger and better things.

Where you start doesn't matter much, just pick a place with a good probability of success. Where you end up is completely up to you.
 

MrChips

Joined Oct 2, 2009
35,018
Start with Arduino because it is friendly and there are lots of examples and support out there.
You can always go back to pick up what you really need to know once you get a taste of it.
 

BobTPH

Joined Jun 5, 2013
11,615
Agreed. Microchip PIC is a chip. Arduino is a system.

Personally, I prefer to use Atmel AVR over a Microchip PIC. The AVR was designed by people who understood what they were doing. It was also designed with C in mind and optimized for a C compiler. PIC was originally intended for hobbyists. Same goes for Arduino.
I have pretty much moved to PIC24/33. It has a very nice architecture with 16 GPRs and 16 bit word size. 64K linear RAM space and up to a Meg of program memory also useable as data ROM. For an old PDP-11 programmer it is a dream!

Bob
 
Last edited:

djsfantasi

Joined Apr 11, 2010
9,237
I have pretty much moved to PIC24/33. It has a very nice architecture with 16 GPRs and 16 bit word size. 64K linear RAM space and up to a Meg of program memory also useable as data ROM. For an old PDP-11 programmer it is a dream!

Bob
And I am willing to bet, unless betting is against the TOS, that the TS has no idea what you just said. Except maybe “I’ve pretty much moved...”.
 

MrChips

Joined Oct 2, 2009
35,018
I have pretty much moved to PIC24/33. It has a very nice architecture with 16 GPRs and 16 bit word size. 64K linear RAM space and up to a Meg of program memory also useable as data ROM. For an old PDP-11 programmer it is a dream!
Geez! You should have a look at STM32.

STM32F4 180MHz, up to 2MB flash, 384KB RAM
STM32F7 216MHz, up to 2MB flash, 512KB RAM
STM32H7 550MHz, up to 2MB flash, 1.4MB RAM
 

SamR

Joined Mar 19, 2019
5,526
Arduino is an impressive package and once you really get into it you will find out it can do quite a bit. Start with a UNO clone and then there are the NANOs and eventually just the AT chip to work from. I've been pleased with the Integrated Developers Environment package used to program with and it is constantly being improved on and expanded to include new hardware.
 

nsaspook

Joined Aug 27, 2009
16,431
One thing to remember as you move to higher complexity 16 and 32 bit chips is the datasheets (written by engineers for other engineers) and what's required to directly program the hardware at the lowest level. Some of us read datasheets as light entertainment before dinner but for a beginner that 1000 page datasheet is an intimidating mass of information with endless register options, clock/logic diagrams, hardware configurations and more. One of the reasons 8-bit pics have survived despite being called dead every ten years, while still being produced and sold in massive numbers is shear simplicity of instruction sets and configurations. The instruction set might be backward, stunted or not exactly suitable for a HLL like C but they are robust to abuse, you can understand it in a reasonable amount of time and use it to make simple things work with a reasonable amount of effort.

The Raspberry Pi Pico looks like a good controller but the chances of most beginners understanding the 637 page datasheet to the level needed for complex direct low-level programming is IMO unlikely.
https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf

Armv6-M Architecture Reference Manual that explains how to program the chip is only 374 pages.
https://developer.arm.com/documentation/ddi0419/latest/

Why use a machine gun to hunt mosquitoes?
 
Last edited:

MrChips

Joined Oct 2, 2009
35,018
That is why if you are now starting out you should not begin with an ARM chip.
The STM32H7 Reference Manual is 3319 pages long.

Start out with an Atmel AVR ATtiny, ATmega or TI MSP430 would be my recommendation.
 

MIS42N

Joined Jan 25, 2013
22
Interesting thread, lots of opinions. From other questions asked by TS, he has some knowledge of Arduino already. Maybe he wants to dive in the deep end.

Learning is different for different people, I can't learn stuff without some sort of target. So I set some minor task (flash a LED) and program it. If that works I'll try something more ambitious. So my learning is an incremental process.

My current hobby project uses a PIC16F1455 which is quite a nice chip to work with. These are the things I learned in the last few months that I hadn't tried before: manipulate the call stack, gate a timer using a comparator, switch from an internal clock to an external clock, retrieve data from program RAM as 14 bit values (2 7-bit ASCII characters), create a 9600 baud software UART receiver (you may laugh at the reason - the PIC runs at 5V because I want a 5V PWM signal out. The input serial data is 3.3V and the PIC when configured for serial input is a Schmitt Trigger input with CMOS levels (0.8 VDD or 4V) so I used a pin configured for TTL levels to save a level shifter). Store data in flash memory. Use the linear model to access RAM via the indirect registers.

Presumably I could pick any architecture and by reading the references get them to do the same thing. The thing is, embedded programming is more about the peripherals than the processor architecture. Knowing how to stop and start timers, interrupt latency, double buffered peripherals, DMA transfers, ADC and DAC, port values v. pin values.

I am an Assembler programmer from way back. Whoever said " If the natural language of the device is what you’re after, then try coding in machine language! Nothing but bits. " - Assembler is the machine language in symbolic form. I looked at programs written in the late 1940s, they were written in symbolic form then hand translated to bits. Assemblers just automate the process, and were created very early on to make the process less error prone.

However, I'm not advocating assembler in particular. My point is, embedded stuff is more about learning the interfaces, and they do pretty much the same thing whatever architecture they hang off.
 

camerart

Joined Feb 25, 2013
3,846
Hi A,
When I started I didn't have the choice, so PIC it was/is.
I will never be able to program, mainly because I learned bad habits along the way, perhaps thinking it was the easiest way.

It's probably a question of whether you want to understand how chips work and have projects in mind that need them, then how deep do you want to go. If you find microcontroller data sheet and see if you are able to remember and work with them, this may give you a guide.

I think that the Arduino system is a bit like lego, in that modules have been programmed and can be downloaded then built into interesting projects, with possiby minimum effort, where I find that PICs are perhaps less popular, especially to the hobbyist.

Like others have said, even though I can't write in assembler, I would learn it if I started again. Also C++ seems to be very popular.
Good luck, Camerart
 

dendad

Joined Feb 20, 2016
4,641
I will vote for the Arduino as "Is Arduino easy to learn or PIC? ".
That does not mean it is the best. The best is almost a religious argument.

My first processor was the Signetics 2650. I had to work out the program on paper by looking up the instructions and writing down the HEX code.
After 40+ years, I can still remember 3F02B4 is Branch Subroutine True Absolute Unconditional, Character Out (at address $02B4).
I did not have an assembler or disassembler program. And the interface was just a TV Typewriter serial interface, originally 110Baud.
Then, I moved to PIC17Cxx chips, in assembler once again.
Next the dsPIC30Fxx were in C, as were the PIC32series.

Now I use Arduinos, STM32, ESP32, BeagleBoneBlack, Raspberry Pi variants...........

BUT! The question was "Is Arduino easy to learn or PIC? ".

The answer just must be Arduino as the support is there, as well as the cheapest systems to start on.
On Ebay, one can get a knockoff Arduino for a couple of dollars, and that is all you need to start with. The programming environment is free as is a vast amount of software.
There are many folk who have a rabid hatred of Arduinos for some reason. These boards are not the best by any means, but as a starting springboard into electronics and programming, they are very hard to beat.
Once you have an interest going, reinforced with successful projects, then step up to better things. There are a great number of really interesting boards and chips available now. The STM32 ARM chips and boards could well be a good next step, and just skip over the 8 bit parts altogether.
 

trebla

Joined Jun 29, 2019
599
Starting with Arduino is simpler just because the Arduino IDE is simple. There are several PIC-based cheap Curiosity and Curiosity Nano boards around and for start with them you do not need any programmer device, just only ordinary USB cable.
But MLAB X IDE with MCC for PIC (and for AVR too) is much more complex than Arduino IDE. In my opinion, this is main difference between Arduino and PIC for beginners.
 

BobaMosfet

Joined Jul 1, 2009
2,211
People who use Arduino’s minimize the complexity of the platform. You still need to know or learn basic electronics. Arduinos do not replace what you need to know, but do make the introduction to microprocessors simpler.

People who use PICs (and other platforms) minimize the complexity of the tools. PICs and other platforms are appropriate for a production or commercial solution.

This is in itself, an oversimplification. So there are difficulties either way. If you are new to microprocessors and electronics, start with an Arduino. And keep in mind the situations where it is appropriate to move to another platform. I have coded an Arduino with a run-time system for animatronics. But the second generation will be a custom board using another platform.
Hi I am new in this field and want to learn programming for Embedded but I am confused between arduino and PIC, which one is better to learn for carrier growth and as per industry demand?
I am adding another response to this, because I think it needs said- perhaps you are asking the wrong question?

Instead of picking a platform, you need to learn C first. And you can do that on your PC. Only once you are comfortable with the C language should you begin considering embedded development- because no matter which platform you choose, you have to know C. If you can't learn C on your PC, don't bother with Embedded.

Your real question is: Can I learn C?

IMHO.
 

MrChips

Joined Oct 2, 2009
35,018
Yes and no.

You do not have to learn C to become an embedded programmer. You need to learn a programming language, any language.
It can be ASM, APL, Algol, BASIC, C, C++, C#, Forth, FORTRAN, LabView, MATLAB, Pascal, Python...
You need to learn programming algorithms, structures, data types, etc.

Granted, the C programming language is the most commonly used language today in the embedded world. If you want to become a professional embedded programmer, learn C. If you want to become an expert embedded engineer, learn C and ASM.
 

nsaspook

Joined Aug 27, 2009
16,431
I am adding another response to this, because I think it needs said- perhaps you are asking the wrong question?

Instead of picking a platform, you need to learn C first. And you can do that on your PC. Only once you are comfortable with the C language should you begin considering embedded development- because no matter which platform you choose, you have to know C. If you can't learn C on your PC, don't bother with Embedded.

Your real question is: Can I learn C?

IMHO.
That's a little backwards IMO. Learning C as the language is the easiest task on the list if you have the slightest ability to program. C was designed to be simple and direct by people that programmed hardware, not a PC class machine. What's harder is using C as the platform for hardware control of devices. What I mean by that is the translation of hardware manipulation requirements into data structures and routines compatible with the abstract machine of C plus the extensions that every embedded system needs to make C work on that exact architecture. Designing embedded data structures should be a priority because with the proper data structures, interfaces and interfacing routines flow naturally with the least amount of needed computing.
https://www.coursera.org/lecture/embedded-software-hardware/1-introduction-to-data-structures-P5wI8
 
Last edited:
Top