CodeBlock IDE and PIC microcontrollers

De WikiRobotics
Saltar a: navegación, buscar


Code::Blocks is a multiplatform open source C/C++ IDE. It can be used with different compilers and cross-compilers. The Code::Block IDE can be used to program the PIC microcontrollers.

Installation on linux platforms

Ubuntu 10.04/10.10

CodeBlocks configuration in Linux (Click to enlarge)


The Code::Blocks IDE is in the ubuntu's repositories. It can be easily installed by means of the ubuntu's software center or Synaptic.

Code::Blocks quick installation. Just click on the link to automatically install Code::Blocks

Optionally it can be installed by means of apt-get:

 sudo apt-get install codeblocks


(See the picture on the right)

  • Start the CodeBlocks (Applications/programming Ubuntu menu)
  • Click on Settings/Compiler and debugger
  • In the top drop-down menu chose "SDCC Compiler"
  • Click on the tab "Toolchain executables"
  • In the dialog "Compiler's installation directory" write /usr/bin
  • Click on Accept button
  • The codeBlocks is ready!!!!

Installation on Windows 7 / windows XP

The installation is straightforward. Just download and execute the following .exe file:

CodeBlock for Windows: codeblocks-10.05-setup.exe

Compiling the "hello world" program

The Codeblocks IDE compiling the ledon example on Ubuntu/Linux 10.10 (click to enlarge)

To verify that the CodeBlock + SDCC compiler are working properly, a "hello world" program will be compiled. This program is called "ledon.c". It just turns on the green led on the Skycube board. In this section we will just test that it compiles correctly (It still will not be downloaded into the board)

  • Download the example file:
  • Uncompress it. The folder ledon will be created
  • Start the codeblock IDE
  • Open the ledon project
  • Compile it Build/build
  • In the folder ledon/bin/Release will be located the ledon.hex which is the binary file that will be downloaded into the Skycube board



  • Feb/20th/2011: This page is started!