Continue to Site

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.

  • 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.

Best compiler's for PIC

Status
Not open for further replies.
GTAman said:
Best compiler's for PIC

any idea's

any language doesn't matter anymore

'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.
 
evandude said:
but if you think C is too complex... then you're probably going to choke when you look at assembly :lol:
Why do you think so? I love asembly, and C looks compex to me!
Everybody likes something else... :D
 
Re: reply

GTAman said:
Is there any books on it?

Not C, assembly

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: **broken link removed**

Mike
 
Jay.slovak said:
Why do you think so? I love asembly, and C looks compex to me!
Everybody likes something else...

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
 
Re: reply

GTAman said:
So you are saying that basic is harder then assembly?

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
 
yes there are lots of books and tutorials on the net which will guide you in programming PICs in assembly. i would recommend that the first thing you look at should be Nigel's tutorials http://www.winpicprog.co.uk

and download the EPE PIC tutorial which is available for download in three parts from the EPE website http://www.epemag.com/library.html.

and here is the link for the microchip university program book list

**broken link removed**
 
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...
 
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.
 
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...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top