cadManiac.org
    navigation
>projects
   KontrollerLab
>login
    KontrollerLab
>info page
>download
>release schedule
>documentation
  introduction
  installation
  first steps
  compiler settings
  linker settings
  assembler settings
  programmer settings
  debugger
    first steps
    configuration
    direct memory debugger
    PC only debugger
    in circuit debugger
  wizards
    seven segments wizards
    dot matrix library wizard
    dot matrix character wizard
    font wizard
>examples
  font wizard tutorial
hosted by
SourceForge.net Logo
    news
>New site up and running
>New project launched:
KontrollerLab
    information
>propose new project
>bugtracking
>FAQ
>contact
>legal disclaimer
>Not logged in.
    KontrollerLab 

First steps

There are many ways of describing the functionality of a tool. Personally, I prefer learning by doing, so this is the way the first steps are organized: You will learn how to setup a new project, add a new C source file and write a few lines of code which make some LEDs blink. Then, You will learn how to build Your project and upload it to Your controller. So the most basic things are illustrated here with a primitive example. For further details, take a glance at the other sections of the documentation.

KontrollerLab airlines now boarding...

I assume that You have the KontrollerLab and the avr-gcc toolchain, as well as the uisp or avrdude programming software installed correctly, and Your programming dongle attatched to Your circuit.

Okay, let's open the KontrollerLab, for example by typing kontrollerlab in a shell. What comes up now is an empty KontrollerLab window. Now, we need to create a new project. Select the "New project" menu entry from the "Project" menu. KontrollerLab now asks You for a local directory to save Your project. It is important to understand that the project must be saved in a local directory on Your computer (or on a network file system like NFS, AFS, SMB..., which seem to be local from the compiler's point of view). In the usual KDE manner, select a project file name. When You click "Open", the new project will be created and opened in the KontrollerLab window. Okay, so far, so good. We need to add some source files now to create a senseful project. There are two possibilities. You can either add an existing file or create a new one:
  • Adding an existing file to Your project Go to the "File" menu, and use the "Open..." menu entry. Select the file You want to add to Your project. When the selected file is not in the project directory, the KontrollerLab will copy it into it. Now, the (copied) file belongs to Your project.
  • Creating a new file Go to the "File" menu, and use the "New -> New" menu entry. Alternatively, hit the "New" button, located in the tool bar. The icon of that tool button should be the same as in the other KDE applications, such as e.g. KWrite. Wait for the tooltips to come up when the mouse pointer remains for about two seconds over the icon, if You are unsure.
    After that, a window will be shown (see figure 1), which allows You to select the kind of file You want to add. For our example, let's say You want to add a new C file. Select the type "C source", and specify the name of the file. Then click on the OK button. That's all.
Figure 1: The new file dialog

KontrollerLab boarding completed ...

You can now start writing Your code. When You want to compile the sources, the best choice is to build the whole project using the "Build all" entry in the "Project" menu. If You encounter problems, You may find help in the compiler settings area. Okay, back to our example with the simple blinking LEDs. Copy the following lines to the C source file You just created:
#include <avr/io.h>

int main()
{
  char state;
  int i, j, k; // Wait counters
  DDRA=0x00; // Set all pins as outputs
  state=0;
  while (1) // Loop forever
  {
    for (i=0; i<10000; i++)
      for (j=0; j<100; j++)
        k++;
    state = ~state;
    PORTA = state;
  }
}

I assume that the LEDs are attatched to the PORTA. The window after writing the code should look like the one shown in figure 2:
Figure 2: The code window

Now You have to choose the microcontroller You write Your program for. Go to the "Project" menu and select the "Configure project" entry. A window comes up, where You can select the controller and some other things, described in the compiler settings. Okay, hit the "Build all" key now to build Your project. A window will come up containing the message box. That box can be docked to the main window by dragging it over a border of the window. That behaviour is the same as in other KDE applications. Just try it, it's easy. The docked window will be docked again the next time You open the KontrollerLab, so this is something You only have to do the first time You use the program.
If there are errors in Your code, You can jump to the erroneous positions in the code by double clicking the error message in the message box.

KontrollerLab crew, please be seated for takeoff...

If everything went fine, it's time to upload the code now. The way You can configure the settings is described in the programmer settings.

For making it short, we will use the "Program toolbar" to erase the device, upload and verify the code. The toolbar looks like this for me (the icons may be different in Your distribution):
Figure 3: The program toolbar

The easiest way to build, erase, upload, and verify is to push the "Ignite" button, depicted left of this sentence.

Push the "Ignite" button now, and Your controller gets programmed. The messages coming from the programming software are shown in the message box.

KontrollerLab takeoff completed.

Congratulations! You just have created Your very first KontrollerLab project. For more information, please check out the other sections of the documentation. If You have any questions, don't hesitate to contact us:
This site was created using free software only:
The GIMP, Quanta, KPovModeler and Povray.
©2006 cadManiac.org