Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How important is it to know PIC assembly for a PIC programmer?

Status
Not open for further replies.

matrixofdynamism

Advanced Member level 2
Joined
Apr 17, 2011
Messages
593
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,681
Assembly offers insight into a device hardware and gives absolute control over how and what a program does. However, usually we write programs in C language for PIC microcontrollers (and others as well for that matter).

I am curious to know that for people that program PIC for living, how important is it to know the assembly language? How often do you have to write instructions in assembly language either as part of a C program or a whole assembly level program. I am not talking about one liners where we are forced to use an assembly level instruction since a C equivlanet may not exist.
 

Goot to know. But just understanding the basics is more than enought.
Anyway, PIC is crap. And atmel is also.
 

What does "understanding the basics" mean? Using PIC is using PIC assembly together with its SFRs. What aspect are you talking about?

If they are crap, what is the alternative?
 

The real problem of all 8 bit pics is a 8 bit address bus. The memory devided by pages for 256 bytes each. And special assembly command allow you to jump between them. This is realy crap.
Alternative - STM8. Basic understanding give you expirience to write optimal code. C code also can be very optimal if you understand how it will be compiled.
 

As Easyrider83 mentioned, considering that some PIC families have a quite limited architecture, it is very important to understand the fundamentals of the microcontroller core that you are working with, as well to comprehend its instruction set in order to know what is it capable to do with the built in resources and also to have a notion of the overhead that a specific implementation in firmware would subject it. High level languages abstract the programmer from the hardware level, not rarely being the reason for the program malfunctioning.
 
Alternative - STM8. Basic understanding give you expirience to write optimal code. C code also can be very optimal if you understand how it will be compiled.

What one would you start with to learn programming? I have been taking a C course online, did a bunch of starter exercises on proteus with some pic examples off their website(using xc8). I am ready to order some hardware to play with and am trying to figure the best way to go.
 
Last edited by a moderator:

Doesn't really matter. Any devboard.
Important to know, that STM8's and STM32's perepherials almost the same. So, the migration from 8 bit to 32 bit takes minimum time.
The power of STM is cheap debugger that support all mcu's.
 
  • Like
Reactions: C1500

    C1500

    Points: 2
    Helpful Answer Positive Rating
I have been taking a C course online, did a bunch of starter exercises on proteus with some pic examples off their website(using xc8). I am ready to order some hardware to play with and am trying to figure the best way to go..

Learn C programming to know the logic flow within a program. Remember that C is a generic programming language and is available for many platforms. By learning C programming language, you will not learn about the underlying hardware architecture.

Once you are halfway through (learning C), start learning the assembly language. Here will you see the naked machine architecture and how to manipulate them. Basic stuff like move and load and shift are universal but these you will learn in an hour. You need to keep the machine hardware picture (the registers_ quite a lot of them) in the back of your mind so that when you find the need, you will know what to look for where...
 
  • Like
Reactions: C1500

    C1500

    Points: 2
    Helpful Answer Positive Rating
And few years of hard work will be spend before your code will become optimal and clean.
 

And few years of hard work will be spend before your code will become optimal and clean.

Writing code is more an art than science; when I first looked at the FFT code, it looked German (no offense meant; I should say Hieroglyphs) for many years. It took many years before I could appreciate the beauty of the algorithm.

Writing code that runs is not at all difficult; I have written several. Maintaining it over the years and facing new demands for features is not at all easy.
 

I get the impression that the main problem (that makes things inconvinient) is the presence of multiple banks. Did I understand that correctly?
 

I think that unless you know assembler you don't really know how a computer works. A PIC is a good choice for a beginner as it is very simple, 32 bit processors tend to be a bit complicated.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top