Code Blocks/SDCC Tutorial - University of Colorado...

16
Code Blocks/SDCC Tutorial

Transcript of Code Blocks/SDCC Tutorial - University of Colorado...

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

Code Blocks/SDCC Tutorial

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Build a project • After you build your project, you will find all the SDCC-

generated files in the project folder in your workspace.