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

upand_at_them

Joined May 15, 2010
939
I disagree about learning and having a good understanding of a specific machine assembly if you're required to code detailed low-level functions on the hardware. The C abstract machine doesn't describe the underlying machine hardware, compilers are not perfect, compiler coded optimizations are not exactly what we need for X hardware interface and there are times you need to completely escape the C abstract machine and OS. To really understand the hardware you MUST know something about the instruction set, memory architecture, register architecture, etc .... Do you believe that Linus (and the people that port Linux to various hardware platforms) don't deeply understand the assembly code the compiler produces to be linked to machine code.
Do you believe that the Mars rover systems programmers deeply understand assembly? It simple isn't necessary anymore.
 

djsfantasi

Joined Apr 11, 2010
9,237
Do you believe that Linus (and the people that port Linux to various hardware platforms) don't deeply understand the assembly code the compiler produces to be linked to machine code.
And do you believe that most of the beginners learning to code are going to have the same objectives and skill set that the Linuses of the world need? Many of them will get by quite well without a deep understanding of assembly language. And most will never see a compiler.

Of a staff of twenty to thirty web site programmers, using Java and PHP, I think one of them understood assembly language. And they developed a high availability, high transaction 24x7 e-commerce site. Quickly. In fact, it never would have been successful with assembly.
 

dendad

Joined Feb 20, 2016
4,641
Do you believe that the Mars rover systems programmers deeply understand assembly? It simple isn't necessary anymore.
I am sure that they do!
One of the aims with the rover would be to get the most out of the software resources. If I was in charge of the rover development, I'd want the people involved to know the system resources to the most extreme level.
A good understanding of the machine code is one of them.
Even if it is programmed in C, I bet there are those on the team that are quite happy poking around at the byte level.
 

dendad

Joined Feb 20, 2016
4,641
Of a staff of twenty to thirty web site programmers, using Java and PHP, I think one of them understood assembly language. And they developed a high availability, high transaction 24x7 e-commerce site. Quickly. In fact, it never would have been successful with assembly.
I doubt web site programmers ever need assembly language skills as they are almost as far away from the actual specific hardware as can be. And their code needs to run on a wide range of systems.
But, in industrial control, and other fields that drive actual hardware, machine level knowledge is very handy.
I do not do much in assembler now, but every now and then it does come in handy.
But, this discussion has moved away from the original question quite a bit.
An Arduino or PIC is not really suited for a high availability, high transaction 24x7 e-commerce site.
 

nsaspook

Joined Aug 27, 2009
16,438
And do you believe that most of the beginners learning to code are going to have the same objectives and skill set that the Linuses of the world need? Many of them will get by quite well without a deep understanding of assembly language. And most will never see a compiler.

Of a staff of twenty to thirty web site programmers, using Java and PHP, I think one of them understood assembly language. And they developed a high availability, high transaction 24x7 e-commerce site. Quickly. In fact, it never would have been successful with assembly.
Different programming worlds that my comments were not directed at. I nor anyone else expects high availability, high transaction 24x7 e-commerce site to be written in asm but you can bet the OS systems guys that wrote the system hardware code will have a few assembly languages in their Quiver of skills.
 

MrChips

Joined Oct 2, 2009
35,022
Does a Mars Rover programmer need to know asm?
Does a Formula 1 race driver need to know how a combustion engine works?

Both questions are irrelevant and does not address the importance of knowing fundamental principles.
 

djsfantasi

Joined Apr 11, 2010
9,237
I agree with both of you. Because it doesn’t disagree with my position. One is that I propose that the number of programming jobs that need assembly skills is relatively small. Second is that this argument always appears when a beginner is looking for advice. They are beginners, not professional firmware or system programmers. In those cases, I believe that our advice should be thus constrained.
 

nsaspook

Joined Aug 27, 2009
16,438
I agree with both of you. Because it doesn’t disagree with my position. One is that I propose that the number of programming jobs that need assembly skills is relatively small. Second is that this argument always appears when a beginner is looking for advice. They are beginners, not professional firmware or system programmers. In those cases, I believe that our advice should be thus constrained.
For more hardware biased beginners in embedded programming a intimate association with actual hardware instructions will IMO provide an fundamentals based foundation that will last a lifetime even on machines where you never look at ASM code. The fundamental principle is learning how to think like a bit/byte manipulating machine operates and how to translate that into any type of programming language that support low-level semantics.

For many hardware oriented people assembly is a more natural skill than a HLL like C because of the need step to convert direct machine operations into a programmer based abstraction. The number of jobs that require direct assembly skills are small but the numbers of programmers who are much improved professional embedded programmers because of previous assembly skills are many. No, you don't need these skills to be a good general programmer but “the dirty low-level details” are where the fun is if you like building hardware too.
 

s14rs4

Joined Sep 15, 2016
75
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 think this thread has strayed from the TS question. It is not about hardware but program language. PIC assembler is device specific, It would be better to learn a high level language such as C/C++ which is portable and would lead to more employment opportunities. Of course understanding the internal workings of an MCU is a great advantage, but the main aim is to learn program structure and practical application. For this I still recommend the Arduino.
 

upand_at_them

Joined May 15, 2010
939
Both questions are irrelevant and does not address the importance of knowing fundamental principles.
Cite specific examples of how assembly is important. This isn't 1970. While I know, use, and kinda like, assembly...it just isn't important today. The belief that it is, is just that: a belief.
 

MrChips

Joined Oct 2, 2009
35,022
Cite specific examples of how assembly is important. This isn't 1970. While I know, use, and kinda like, assembly...it just isn't important today. The belief that it is, is just that: a belief.
Can you site me specific examples where knowledge of fundamental arithmetic is not required in today's society?

Let me phrase it differently. If I were looking to hire an embedded engineer and you had no knowledge of asm then you would not make the list of potential candidates because the selected candidates already have that knowledge.
 

MrChips

Joined Oct 2, 2009
35,022
I think this thread has strayed from the TS question. It is not about hardware but program language. PIC assembler is device specific, It would be better to learn a high level language such as C/C++ which is portable and would lead to more employment opportunities. Of course understanding the internal workings of an MCU is a great advantage, but the main aim is to learn program structure and practical application. For this I still recommend the Arduino.
I am not sure than anyone here is asking to learn PIC assembler.

I am specifically referring to learning how a microprocessor works by having a knowledge of the inner workings of machine architecture, machine code and assembler. There is a lot to learn by coding a machine in binary by hand.
 

DickCappels

Joined Aug 21, 2008
10,662
Since the Mars rover is currently in the news, it should be pointed out that the rover systems were programmed in C, not assembly. Assembly just isn't pertinent today.
Ever notice the number of microcontrollers on the market with little or no RAM and only 1 or 2 k or program memory space? Try getting anything useful to compile for those machines.
 

Wolframore

Joined Jan 21, 2019
2,619
I use a lot of 1k chips but do not write in assembly, you need to be aware of the implications of your variable types and how you organize your codes. Much of it has to do with memory allocations.
 

DickCappels

Joined Aug 21, 2008
10,662
You know that .hex file that you burn into the controller? That's machine code and constants.

We usually don't write in machine code since most of us have computers (these days).
 

bogosort

Joined Sep 24, 2011
696
People are making a false equivalence between assembly languages and the "byte level" hardware knowledge required for effective embedded programming. Embedded programming is all about interfacing with peripherals, which requires a solid understanding of bus protocols, data formats, and peripherals at the register level. Assembly language not required. On the processor side, we need to understand its memory interface, how pins are addressed, how interrupts are handled, etc. We learn all this stuff by reading datasheets, not by learning an assembly language.

Knowing an assembly language is neither necessary nor sufficient for being an effective embedded programmer.

When I was in school we had to design our own 8-instruction single-cycle processor, with datapath and ALU, implement a toy assembly language for it, and then write a program in it to do some simple task like calculate Fibonacci numbers. Great way to really get a sense of how a CPU works, but definitely not the only way.
 

geekoftheweek

Joined Oct 6, 2013
1,429
And do you believe that most of the beginners learning to code are going to have the same objectives and skill set that the Linuses of the world need? Many of them will get by quite well without a deep understanding of assembly language. And most will never see a compiler.

Of a staff of twenty to thirty web site programmers, using Java and PHP, I think one of them understood assembly language. And they developed a high availability, high transaction 24x7 e-commerce site. Quickly. In fact, it never would have been successful with assembly.

While the site is impressive I'm sure. Unfortunately web programming and hardware level programming have nothing to do with each other. It's kind of like saying a baker can butcher a cow. Both use totally different tools and skill sets to get their end products. The closest to hardware level programming a web site should get is a PHP (or whatever) query to a database program... especially an e commerce site.
 

djsfantasi

Joined Apr 11, 2010
9,237
As I’ve mentioned before (without much detail), we had to program a MIX Computer simulator in Computer Science. A MIX computer was used in Donald Knuth’s tome, The Art of Computer Programming.

That was my introduction to machine code and assembly. In my 50+ years of programming, I used assembly once, to emulate a Western Union TWX terminal on a TRS-80 Model II.

While I didn’t do the programming, a second project used assembly to replace routines written in FORTRAN that were in the critical path for a heirarchical database system (before there were commercial database systems available).

So I’m 50+ years, writing database systems, terminal emulators, XSL-like software, proprietary languages and run-time systems.... Plus more... I used assembly twice.

One of the reasons for diminished value of assembly, IMHO, is the ever increasing capabilities of computing platforms. Why code in assembly when current processors can execute an interpreter as fast?

I am NOT advocating the death of assembly. It has its place (see the post regarding 1K microprocessors). But I don’t see the widespread use of it since the 80s.
 
Top