The document provides instructions for setting up Code Blocks and the SDCC compiler to create and build projects for the MCS51 microcontroller family. It outlines downloading and selecting the necessary software, configuring a project within Code Blocks to use SDCC, and describes the steps to build a project to generate output files.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
110 views16 pages
CodeBlocks-SDCC Tutorial
The document provides instructions for setting up Code Blocks and the SDCC compiler to create and build projects for the MCS51 microcontroller family. It outlines downloading and selecting the necessary software, configuring a project within Code Blocks to use SDCC, and describes the steps to build a project to generate output files.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16
Code Blocks/SDCC Tutorial
Install Software
• Download and install SDCC 2.6.0
• Download and install Code Blocks
• Run Code Blocks
Select SDCC • Click ‘Compiler and debugger’ under the ‘Settings’ tab, choose SDCC from the list of available compilers . You might also set it as the default compiler. Create a project • Go to ‘File->New->Project’ and select ‘Empty project’. A ‘Console application’ project should also work. Create a project (cont.) Create a project (cont.) • Make sure SDCC is selected as your compiler, uncheck the ‘Create “Debug” configuration box and keep the “release” box checked. Click finish. Create a project (Cont.) • You might receive a few warnings; just ignore them! Project properties • Right-click your project name in the ‘Management’ window and click ‘Properties’. Project properties (cont.) • In the ‘Build targets’ tab, choose the ‘Console application’ type, rename the output file extension to “.hex”, uncheck the ‘Auto-generate extension’ box and click ‘Build options’. Project properties (cont.) • From the ‘MCS51 Options’ category, you can choose your memory model. ‘General’ category lets you choose other SDCC options such as “Verbose”. Project properties (cont.) • You can place your linker options in the ‘Other linker options’ box in the ‘Linker settings’ tab. Create a new file Create a new file (cont.) • You will be asked if you want the new file to added to the project. Click yes. Create a new file (cont.) Create a new file (cont.) • You will notice that a ‘Source’ folder is automatically created for the new file. If the you create a header (.h) file, a ‘Headers’ folder will be created instead. Build a project • After you build your project, you will find all the SDCC- generated files in the project folder in your workspace.