- Published: Sunday, 15 March 2009
- Written by Digital DIY
- Hits: 4709
PIC's are essentially micro chips with user designed programs on them to perform any range of tasks. The creation of these programs is an integral part during the development phase, so its best to choose a compiler that suits you.
Whats this about a compiler? Digital-DIY focuses more on the higher language programming that provides quick and powerful integration into any project, but that's not where it all begins for PIC's.
Program information stored in the ROM of a PIC is in the form of machine code; which would appear to any normal person as a bunch of random hex numbers. The next level up of program code is called assembly language.
Assembly programming is also known as "bit banging" and while its the original programming language of the PIC range, to perform a simple tasks quickly becomes extremely complex. As micro controllers boomed in popularity, so too did the range of development software available for end-users which allowed common programming languages such as Basic and C to be utilised. These program tools are called compilers and put simply, they compile all of the required Assembly code so that the programs behaves with the same intent of that of the higher language. Consider this small program written with Swordfish;
The program is fairly well commented so you can see what is happening, but did you notice how simple the commands are? Swordfish compiles this code to 609 program bytes of machine code.
Which brings me to my next point - some compilers are better then others, much better. Some compilers are buggy and do not produce efficient code, inducing undesired overheads. It is worth the $100-$200 on a good compiler as it will save you hours upon hours of development time. Important features to look for in compilers are; free updates, rich libraries, extensive support.
Popular compilers out there that are worth the venture are explained and can be downloaded here.