Using SDCC

January 21st, 2007 liewsheng Posted in SDCC | Hits: 48001 | 3 Comments »

If you are trying to build your own microcontroller system, then SDCC is suitable for you. You can adopt SDCC with no cost (license under GPL) and it supports under both Windows and Linux platform. SDCC able to compile C code for difference microcontroller, such as MCS-51, Z80, Motorola 68HC08 based MCUs and even Microchip’s MCU PIC and PIC18. You can get more information for SDCC from here. To install SDCC you can:

sudo apt-get install sdcc

or compile it from the source. The step to install SDCC from sources is showing here. So when you want to compile your C code, just enter:

sdcc filename.c

If you need to specified the cpu architecture, uses ‘-m’:

sdcc -mpic16 filename.c

The command line above will be used to compile code for PIC16. Here is the list of architectures that supported with ‘-m’ :


By default SDCC will create Intel Hex files, if you need other format just specified with ‘–out-fmt-xxx’:

sdcc -mpic16 --out-fmt-xxx filename.c

where ‘xxx’ can be replace with the format list as below:

ihx - Intel hex file format (by default)
s19 - Motorola s19 format
elf  - Linux ELF format

3 Responses to “Using SDCC”

  1. This is indeed interesting, I was once interested in software development on embedded device too :)

  2. Very Useful Information and Working. Please suggest any procedure to transfer ihx(.hex) to p89v51rd2 microcontroller?

  3. wordimpress com how to use desktop server

Leave a Reply