1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Best compiler's for PIC

Discussion in 'Microcontrollers' started by Roboticinfo, Apr 22, 2005.

  1. Roboticinfo

    Roboticinfo New Member

    Joined:
    Jan 15, 2005
    Messages:
    1,037
    Likes:
    0
    Location:
    USA, California
    Best compiler's for PIC

    any idea's

    any language doesn't matter anymore
     
  2. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,216
    Likes:
    640
    Location:
    Derbyshire, UK
    'Best' isn't an absolute, it's simply personal opinion - I would suggest that 'best' is MPASM, the MicroChip assembler, simply because that is the closest to the actual machine code the PIC runs.

    Any compiler simply generates assembler, which is then converted to machine code by an assembler (either MPASM or a different one), so a compiler is always at least one further stage removed from the hardware. The compiler also produces code that the compiler writer wants, not code that you want - in general any compiler produced code is likely to be slower and longer than decently written assembler - however, it's likely to be much faster to write using a high level language, and that mostly compensates for the slower running code. With a good compiler it mostly won't be a great deal slower than assembler, and you can always insert assembler for speed critical sections - but almost all PIC programs spend most of their time wasting time, they are usually far too fast for what you want.
     
  3. Roboticinfo

    Roboticinfo New Member

    Joined:
    Jan 15, 2005
    Messages:
    1,037
    Likes:
    0
    Location:
    USA, California
    reply

    Is it free?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,216
    Likes:
    640
    Location:
    Derbyshire, UK

    Re: reply

    MPASM is free, it's part of MPLAB, a free download from MicroChip.
     
  6. Roboticinfo

    Roboticinfo New Member

    Joined:
    Jan 15, 2005
    Messages:
    1,037
    Likes:
    0
    Location:
    USA, California
    reply

    Does it program alot of PIC's?
     
  7. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,216
    Likes:
    640
    Location:
    Derbyshire, UK
    Re: reply

    It programs ALL PIC's, it's the official assembler provided by the PIC manufacturer.
     
  8. evandude

    evandude New Member

    Joined:
    Oct 1, 2003
    Messages:
    1,395
    Likes:
    5
    Location:
    Maine, USA
    but if you think C is too complex... then you're probably going to choke when you look at assembly :lol:
     
  9. Jay.slovak

    Jay.slovak Active Member

    Joined:
    Jan 11, 2005
    Messages:
    1,726
    Likes:
    5
    Why do you think so? I love asembly, and C looks compex to me!
    Everybody likes something else... :D
     
  10. Roboticinfo

    Roboticinfo New Member

    Joined:
    Jan 15, 2005
    Messages:
    1,037
    Likes:
    0
    Location:
    USA, California
    reply

    Is there any books on it?

    Not C, assembly
     
  11. upand_at_them

    upand_at_them Member

    Joined:
    Apr 23, 2005
    Messages:
    609
    Likes:
    8
    Location:
    Pennsylvania, U.S.
    Re: reply

    It's not at all difficult to learn assembly. The difficulty is that it is so low level that it requires a lot of thought to do even moderately complex tasks.

    Check out the PIC midrange manual on Microchip's website.

    Also check out this assembly tutorial for PICs: http://www.mikroelektronika.co.yu/english/product/books/PICbook/0_Uvod.htm

    Mike
     
  12. Roboticinfo

    Roboticinfo New Member

    Joined:
    Jan 15, 2005
    Messages:
    1,037
    Likes:
    0
    Location:
    USA, California
    reply

    Is assembly close to basic or is it way diiferent.

    Also why is it free? :?
     
  13. samcheetah

    samcheetah New Member

    Joined:
    Dec 30, 2003
    Messages:
    872
    Likes:
    0
    Location:
    Pakistan
    wow, you are the first person who i have seen saying that. C is supposed to be a higher level abstraction of assembly language which means that it is supposed to be easier that assembly for really large programs. but as you have said, everybody has his own likes and dislikes

    GTAman most of the books for PICs use assembly. go to microchip's website and then click the link university corner. there you will find a book list. a great majority of those books use assembly for PIC.

    assembly is more close to the hardware. its is quite different from basic because just like C, basic is a higher level abstraction of assembly. that means you will have to learn the rules and styles of assembly programming which will greatly differ from basic programming. but if you are good at any programming language you can be good at any other one too.

    and i simply dont have any answer for your second question. it free because its just "free". actually assemblers are always available free of cost. if they would charge $$'s for assemblers no one would buy their microcontrollers.

    i hope that helps
     
  14. Roboticinfo

    Roboticinfo New Member

    Joined:
    Jan 15, 2005
    Messages:
    1,037
    Likes:
    0
    Location:
    USA, California
    reply

    So you are saying that basic is harder then assembly?
     
  15. samcheetah

    samcheetah New Member

    Joined:
    Dec 30, 2003
    Messages:
    872
    Likes:
    0
    Location:
    Pakistan
    Re: reply

    no im not saying that. a higher level of abstraction means that you dont have to be specific to the platform you are programming in. you just write an algorithm and it compiles to the format compatible with the platform. with assembly you have to set values of registers, know about addressing modes, know the types of registers, learn the whole instruction set, write lots of code that looks like greek etc. but high level languages simplify the programming process. in a high level language you write your algorithm in a meaningful way just like in english. so basic and C are easier than assembly. but the more higher you go in the level of abstraction the more inefficient your programming becomes. assembly programming is efficient because you are more "close" to the hardware.

    i hope that helps
     
  16. Roboticinfo

    Roboticinfo New Member

    Joined:
    Jan 15, 2005
    Messages:
    1,037
    Likes:
    0
    Location:
    USA, California
    reply

    So there is books for assembly for beginner's based around the PIC right
     
  17. samcheetah

    samcheetah New Member

    Joined:
    Dec 30, 2003
    Messages:
    872
    Likes:
    0
    Location:
    Pakistan
  18. Roboticinfo

    Roboticinfo New Member

    Joined:
    Jan 15, 2005
    Messages:
    1,037
    Likes:
    0
    Location:
    USA, California
    reply

    Thank's
    your'e the best

    :wink:
     
  19. Agent 009

    Agent 009 New Member

    Joined:
    May 28, 2003
    Messages:
    522
    Likes:
    0
    Location:
    Lebanon
    i think assembly language is very processor-specific, so if u want 2 program ur processor, u'll use different programing if it's a Motorolla, Intel or MicroChip... And my best way to learn a programing language is 2 practice it, not just read books...
     
  20. Roboticinfo

    Roboticinfo New Member

    Joined:
    Jan 15, 2005
    Messages:
    1,037
    Likes:
    0
    Location:
    USA, California
    reply

    I do both, you can't just learn by reading a book.

    You have to have hand's on expierince.

    At least in my opinion.
     
  21. Jay.slovak

    Jay.slovak Active Member

    Joined:
    Jan 11, 2005
    Messages:
    1,726
    Likes:
    5
    If you are serious about PIC programming, you should learn Asembly of the Procesor first. Only then you will understand what is happenning in the PIC. After you know asembly you can move to high level programming. :D Atleast I think this is the best way how to learn PICs...
     

Share This Page