Thursday, July 14, 2011

MikroC

MikroC is a C Compiler for PIC as well as some other microcontroller. It has large precompiled library to be used in accessing the peripheral that are connected the PIC microcontroller. MikroC has an independent IDE which doesn't need to be plugged in to MPLAB. In addition, MikroC IDE has numerous tools such as ASCII chart, EEPROM Editor, UART Terminal, GLCD Editor and etc which will further be described later.

Setting up MikroC project



  1. Click Next.




Figure 1: New Project Wizard


  1. Select the Device that you want to use. Click Next.




Figure 2: Choosing Device


  1. Select the clock frequency. Click Next.




Figure 3: Setting the clock


  1. Choose the location where the files are to be saved. Click Next.




Figure 4: Specifying the location of the file to be saved


  1. Here, you can choose to include all library provided by MikroC or select a few that you will be using if you know which has to be used. Click Next


All the libraries that are not used have to be removed by unselect all the libraries later.



Figure 5: Choosing the library


  1. Select Open Edit window to set Configuration bits. Click Finish.




Figure 6: Last step in new project Wizard


  1. Figure 7 will be prompt. Choose the appropriate configuration fuse settings. Click OK.




Figure 7: Project configuration fuse settings


  1. Add the related .c files to sources and .h to header files. Other files may also be added. You should have similar layout as Figure 8.




Figure 8: Project Manager


  1. Figure 9 shows the MikroC libraries. All libraries that are not used should be unselected. Otherwise, it might cause compilation error for some cases.




Figure 9: MikroC libraries


  1. Go under tools you will find the list of additional tools that might help you perform your codings.




Figure 10: Additional useful tools in MikroC


  1. Click Build. If your code is error-free, you should get Figure 11 stating Finished successfully.




Figure 11: Compilation status

Conclusion


Learning how to use a compiler such as MikroC would help beginners to build their project quickly as advance peripheral libraries are provided. These libraries are: USB, GLCD as well as Ethernet and etc.

No comments:

Post a Comment