![Page 1: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/1.jpg)
Code Blocks/SDCC Tutorial
![Page 2: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/2.jpg)
Install Software
• Download and install SDCC 2.6.0
• Download and install Code Blocks
• Run Code Blocks
![Page 3: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/3.jpg)
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.
![Page 4: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/4.jpg)
Create a project • Go to ‘File->New->Project’ and select ‘Empty project’. A
‘Console application’ project should also work.
![Page 5: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/5.jpg)
Create a project (cont.)
![Page 6: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/6.jpg)
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.
![Page 7: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/7.jpg)
Create a project (Cont.)
• You might receive a few warnings; just ignore them!
![Page 8: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/8.jpg)
Project properties
• Right-click your project name in the ‘Management’ window and click ‘Properties’.
![Page 9: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/9.jpg)
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’.
![Page 10: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/10.jpg)
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”.
![Page 11: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/11.jpg)
Project properties (cont.)
• You can place your linker options in the ‘Other linker options’ box in the ‘Linker settings’ tab.
![Page 12: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/12.jpg)
Create a new file
![Page 13: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/13.jpg)
Create a new file (cont.)
• You will be asked if you want the new file to added to the project. Click yes.
![Page 14: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/14.jpg)
Create a new file (cont.)
![Page 15: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/15.jpg)
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.
![Page 16: Code Blocks/SDCC Tutorial - University of Colorado Boulderecee.colorado.edu/~mcclurel/CodeBlocks-SDCC_Tutorial.pdf · Code Blocks/SDCC Tutorial . Install Software •Download and](https://reader031.vdocuments.us/reader031/viewer/2022012318/5a79e3fc7f8b9a9e0c8de436/html5/thumbnails/16.jpg)
Build a project • After you build your project, you will find all the SDCC-
generated files in the project folder in your workspace.