3.1 C Languages for Microcontrollers

There are basically three types of C compilers in the market for the PIC microcontrollers, depending upon the type of microcontroller used. Some compilers are available for the low-end microcontrollers, such as the PIC10/12/16 series. Some compilers are available for the mid-range microcontrollers, such as the PIC18 series. Some compilers are specifically designed for the mid-range PIC24 series of microcontrollers, and a few compilers are available for the high-end PIC32 series of microcontrollers.

In this book we shall be using the mid-range PIC18 microcontrollers in our designs and examples. There are several C compilers in the market developed for the PIC18 series of microcontrollers. Some of the popular C compilers used in the development of educational, domestic, commercial or industrial PIC18 microcontroller based projects are:

  • mikroC Pro for PIC C compiler;
  • PICC18 C compiler;
  • C18 C compiler;
  • CCS C compiler.

mikroC Pro for PIC C compiler has gained much popularity in recent years, because of its low cost, ease of use and full support for various development boards. This compiler has been developed by MikroElektronika (Web site: www.mikroe.com) and is one of the easy-to-learn compilers with rich resources, such as a large number of built-in library functions. The compiler provides an integrated development environment (IDE) with built-in editor, compiler, simulator and an in-circuit-debugger (e.g. mikroICD). Users can write a program using the built-in editor, then compile and simulate the program with the click of a few buttons. The final working program can be downloaded to the target microcontroller by clicking a button. In addition to the simulator, users can carry out real-time debugging of their applications using the built-in in-circuit-debugger. A demo version of the compiler with a 2 KB program limit is available from MikroElektronika for educational use or for learning the basic features of the compiler. Users can upgrade to the full version after making the necessary payment. The full version requires a dongle to be connected to the USB port for compiling programs greater than 2 KB, or users can choose to tie the compiler to their PCs by registering using the serial number of their PCs. In addition, the company offers low-cost integrated packages, including the compiler and a hardware development board. In this book we shall mainly concentrate on the use of the microC compiler, and all of the projects are based on this compiler.

PICC18 C compiler is another popular C compiler, developed by Hi-Tech Software (Web site: www.htsoft.com). This compiler has two versions: the standard compiler and the professional version. A powerful simulator and an ITD (Hi-Tide) are provided by the company. PICC18 is supported by the PROTEUS simulator (www.labcenter.co.uk), which can be used to simulate PIC microcontroller based systems with various peripheral devices, such as LEDs, motors, buttons, and so on. A limited period demo version of this compiler is available from the developers' Web site.

C18 C compiler is a product of the Microchip Inc. (Web site: www.microchip.com). A limited period demo version, and a limited functionality version with no time limit of C18, are available from the Microchip Web site. C18 includes a simulator, and supports hardware and software development tools, such as in-circuit-emulators (e.g. ICE2000) and in-circuit-debuggers (e.g. ICD2, ICD3, Real-Ice, and so on). C18 includes a large number of library functions that can be used during program development. The compiler is based on an integrated environment where users can create programs, compile them, and then download to the target microcontroller using either a suitable programmer (or debugger) or using a development board with built-in PIC microcontroller programmer hardware.

CCS C compiler has been developed by the Custom Computer Systems Inc (Web site: www.ccsinfo.com). The company provides a limited period demo version of their compiler for users who may want to evaluate the compiler. CCS compiler provides a large number of built-in functions and supports an in-circuit-debugger (e.g. ICD-U40), which aids greatly in the development of PIC18 microcontroller based systems. CCS C compiler is very fast and produces compact code. The compiler is fully compatible with various hardware development boards offered by the developers. In addition, the company offers low-cost integrated packages, including the compiler and a hardware development board. The syntax of the compiler is somewhat different to the other C compilers. A large number of examples and tutorials are provided by the developers to help users in their projects.

In this book we shall be looking at the features of the popular and powerful mikroC Pro for PIC programming language, and this language will be used in all of the projects in the book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.21.109