1. Introduction

The CoIDE environment is the environment of choice for the Simplecortex. The debugger on the Simplecortex is designed for CoIDE. This tutorial will explain how to start a new project, how to import a project, how to add libraries and how debugging works. CoIDE can be downloaded from www.coocox.com
2. Video tutorial

A video tutorial on how to make your first project can be found here:

3. Installing

It is recommended to install CoIDE and the debugger drivers trough CoCenter. CoCenter can be downloaded here: http://www.coocox.org/CoCenter.htm After CoCenter is installed you can download and install CoIDE and the drivers trough CoCenter.

In CoCenter the CooCox CoIDE and the CooCox ColinkEx USB driver needs to be installed. Always plug the Simplecortex in before installing the driver. CoFlash can be used to load a program in the Simplecortex without CoIDE but it’s not required to be installed.
4. CoIDE environment

  1. Project explorer view: the project explorer view gives you a view of your current project.
  2. Editor: the editor window your code is displayed and can be edited.
  3. Panel pane: in the panel pane extra panels can be stored, normally the Help and Outline pane can be viewed here.
  4. Console and problems view: The console and show status information on compiling and debugging.
5. Starting a new project

To start a new project in CoIDE, go to project in the upper left corner and select
new project.
new project wizard will pop up. Enter a name for your project in the project wizard:
For this tutorial the project will be called Testproject. The project is now created. Now CoIDE needs to know what microcontroller is used. The Simplecortex uses the LPC1769.
After the correct microcontroller is selected the repository is shown. The repository is the place where you can add libraries made by CooCox. To make the microcontroller work some libraries are required. Here is a picture of the repository with the correct libraries imported:
6. Adding libraries to a project

To use libraries for the Simplecortex they have to be added to the project. This can be done by just drag&drop in windows, drag them from the folder where they are stored to the project. Almost every library has a .C and an .H file. The .H files goes in the folder lpc17xx_lib  -->include and the .C file goes in the folder lpc17xx_lib --> source.
Here a screenshot of a project with the timer and GPIO libraries added to the correct folder:

When using example codes that require a lot of libraries like the LCD example, adding all the libraries to the lpc17xx_lib folder can be a bit unorganized. It is also possible to make a separate folder to place all libraries in. To do this right click on the project name, Testproject for example, and press “New folder”. Name this folder accordingly, if it’s used for the LCD library call it LCD or something like that. Now it has to be added to the build, else the folder will be ignored when the compiler makes the code for the microcontroller. To do this, right click on the project name and press “properties”. Now click on “Add” in the Include paths section. A new window will pop up, press “Workspace” and select the new folder. It is now included and can be used, drag and drop libraries in it to use them. When including a library from the folder use #include “foldername/library.h” instead of #include “library.h”

7. Opening example projects

All example projects are in a zip file. To open an example project first unzip it. It is recommended to place the unzipped example project in an easy to remember folder. "Documents\CoIDE examples" for example. After that the example projects can simply be selected by clicking projects in the top middle in CoIDE and select "Open project" and find the example project that needs to be opened.
8. Debuffing in CoIDE

A big difference between the Simplecortex and most 8 bit microcontroller boards like the arduino is that the Simplecortex has some advanced debug options. For this example the GPIO Read example from the GPIO tutorial is used. It reads out an IO port and changes an LED accordingly, for more info see the GPIO Tutorial. To start debugging the project has to be compiled first. This is done by pressing the Build button on the menubar:

This compiles the code into machine language the Simplecortex can execute. The console and problems view will tell if the build was successful and if not, what problems there are. After the compiling is done, press the Debug button to start debugging. Now CoIDE will connect to the Simplecortex, upload the program and enter debug mode.
The menu bar now has a Play, pause and stop button. The pause button pauses the Simplecortex. When its paused the Simplecortex stops executing code and remains at the last line of code it executes. When play is pressed it will continue. With the stop button the Simplecortex stops debugging and it's again possible to edit and upload new code. The button left of the play button resets the Simplecortex, it will stop debugging and enter debugging mode directly after stopping.
In the bottom right corner variables are listed, when the code is paused the value of the variables will show up here. In debugging mode it is possible to place so called "Breakpoints". A breakpoint is a point in the code where the Simplecortex will pause. If the code doesn't work the way it is intended it's easy to find problems by placing breakpoints on places where the code doesn't work. With the arduino and a lot of other 8 bit dev boards the only way of looking for errors was by sending data back to the PC with the serial port.
To place a breakpoint double-click in the bar in front of the line of code where the Simplecortex needs to pause. For example at the line if (var == 1):

When pressed play the code will run until it reaches the breakpoint and pauses. The value of var can be seen in the bottom right screen or by hovering the mouse pointer over var:

Variables can also be changed when the Simplecortex in paused. In the variable viewer in the bottom right corner the value can be adjusted. It is also possible to add a condition to a breakpoint. For example, only if var contains the value 1 the Simplecortex should pause on that line. To do that, right click on the breakpoint and select "breakpoint properties". In the pop up windows "Common" should be selected. To add the condition that the Simplecortex should only pause when var contains the value 1 the line "var == 1" is added to Condition.
Now the Simplecortex will only pause when var contains the value 1.
Copyright 2011. Joomla 1.7 templates - Joomla template maker. The Simplecortex is developed by BRC-Electronics