code blocks/sdcc tutorial - university of colorado...
TRANSCRIPT
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
Create a project • Go to ‘File->New->Project’, select ‘MCS51 Project’, and click ‘Go’.
3 © Linden McClure, Ph.D. 10/13/2013
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
Create a project (cont.) • Ensure “Create Debug configuration” is deselected to avoid warnings
Deselect Debug
5 © Linden McClure, Ph.D. 10/13/2013
Create a project (cont.) • Select Large memory model
Select Large Memory Model
6 © Linden McClure, Ph.D. 10/13/2013
Project properties • Right-click your project name in the ‘Management’ pane and click
‘Properties’.
7 © Linden McClure, Ph.D. 10/13/2013
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
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
Project properties (cont.)
11 © Linden McClure, Ph.D. 10/13/2013
• Add any other desired compiler flags to the ‘Other options’ tab.
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
Build a project • To build the project right click on the Project name and select Build, or use
the “ “ icon at the top of the Code::Blocks screen.
13 © Linden McClure, Ph.D. 10/13/2013
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.
Custom Settings • For changing syntax color go to Settings->Editor->Syntax highlighting
15 © Linden McClure, Ph.D. 10/13/2013
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
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 computer
system, 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
Compiler Settings
• To set compiler settings go to Settings->Compiler
18 © Linden McClure, Ph.D. 10/13/2013