CodeBlocks-SDCC Tutorial 10-13-2013

download CodeBlocks-SDCC Tutorial 10-13-2013

of 19

Transcript of CodeBlocks-SDCC Tutorial 10-13-2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    1/19

    Code Blocks/SDCC Tutorial

    1 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    2/19

    Process Flow

    Download and install SDCC 2.6.0

    Download and install Code Blocks 12.11

    Run Code Blocks and configure project

    2 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    3/19

    Create a project Go to File->New->Project, select MCS51 Project, and click Go.

    3 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    4/19

    Create a project (cont.)

    Enter the project name

    Enter location of the project

    Click Next

    Fill in the project name and location and click Next

    4 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    5/19

    Create a project (cont.) Ensure Create Debug configuration is deselected to avoid warnings

    Deselect Debug

    5 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    6/19

    Create a project (cont.) Select Large memory model

    Select Large Memory Model

    6 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    7/19

    Project properties Right-click your project name in the Management pane and click

    Properties.

    7 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    8/19

    Project properties (cont.) Select Build targets and then select Build options.

    Select Build targets

    Select Build options

    8 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    9/19

    Project properties (cont.) In the build options, on the Compiler settings tab, select the Policy: Use target options only.

    Ensure Verbose, Intel MCS51, MCS51 large model and Output Intel Hex are selected.

    9 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    10/19

    Project properties (cont.)

    10 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    11/19

    Project properties (cont.)

    11 Linden McClure, Ph.D.10/13/2013

    Add any other desired compiler flags to the Other options tab.

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    12/19

    Project properties (cont.) Go to the Linker settings tab.

    Select Policy as Use Target options only, include the linker options, then select OK.

    12 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    13/19

    Build a project

    To build the project right click on the Project name and select Build, or usethe icon at the top of the Code::Blocks screen.

    13 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    14/19

    Build a Project

    Check Build messages and Build log tabs for errors.

    14 Linden McClure, Ph.D.10/13/2013

    When compiling a real source file, this output file will be multiple KB in size.

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    15/19

    Custom Settings For changing syntax color go to Settings->Editor->Syntax highlighting

    15 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    16/19

    Custom Settings(cont.) Spell checker can produce an unnecessary effect for words not in the

    dictionary

    To remove the effect go to Settings->Editor->SpellChecker and disable

    spell checker

    16 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    17/19

    Compiler Path Settings

    Note:- The workstations in the ECEE 2B37 lab have

    the correct path settings for the SDCC compiler

    Note:- When using your own personal computersystem, you may need to set the correct path

    variable for the SDCC compiler as shown in the

    following slides

    17 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    18/19

    Compiler Settings

    To set compiler settings go to Settings->Compiler

    18 Linden McClure, Ph.D.10/13/2013

  • 8/10/2019 CodeBlocks-SDCC Tutorial 10-13-2013

    19/19

    Compiler Settings Go to Toolchain executables and enter the path.

    You can also use Auto-detect to let Code::Blocksfind the SDCC compiler in the system.

    19 Linden McClure, Ph.D.10/13/2013