PIC and the Sdcc




Magyar English

pic sdcc


Surely, many of you wanted to give a try to the open source SDCC C compiler. The program supports many chips of the 14 and 16 bit controller families from Microchip since several years. I gave it a try couple of time, but due to the generated ugly code, I just ignored it.\\ This has been changed.

I must note that there are cases, when the compiler can generate quite efficient code compared to our self made assembly. When we keep in mind, some of the optimisation technics, we can help the compiler to further improve the code. We can improve our knowledge by reading the user manual of the compiler. It was hard to start coding with this compiler, because I could not find good example files or projects. I hope that those, who have not tryed this compiler can much easier to start his/her project with the information supplied below.

Surely many of you afraid using the command line. During the compilation, we can feed many parameters to the compiler, therefore the automation of the compilation is recommended. I think most of you heard about the make utility and they are afraid using it. It is due to many strange, complicated and hardly understandable commands. Unfortunately, this is one of the best tools I know, therefore I have created one makefile, what can help us to compile simple or complex projects.


Unfortunately, I found very few example files available on the internet:


With the help of the makefile we can make single or multiple file projects. We can use it for C or assembly codes as well. It can be downloaded here.

Template project

You can start your project using this sample project archive based on PIC18F458.

Page last modified on 2008.11.26. 23:31:55

Copyright Alex 2007-2015