| |
| navigation | |||||||
| |||||||
| news | |||||||
| |||||||
| information | |||||||||||||||||||
| |||||||||||||||||||
| KontrollerLab | |||||||||
First stepsThere 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:
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:
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):
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:
| |||||||||