en:examples:setup:windows
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:examples:setup:windows [2010/02/04 15:30] – raivo.sell | en:examples:setup:windows [2020/07/20 12:00] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ===== Installation ===== | ===== Installation ===== | ||
| - | You need the following software which can be downloaded from manufacturers homepage or acquired from the CD supplied with the HomeLab | + | You need the following software which can be downloaded from manufacturers homepage or acquired from the CD supplied with the HomeLab |
| **1. AVR Studio** | **1. AVR Studio** | ||
| Line 13: | Line 13: | ||
| **2. WinAVR** | **2. WinAVR** | ||
| - | WinAVR is a GNU-GCC compiler for AVR microcontrollers. This is a freeware which can be downloaded from Sourceforge webpage. During the installation process WinAVR offers a folder name contining | + | WinAVR is a GNU-GCC compiler for AVR microcontrollers. This is a freeware which can be downloaded from Sourceforge webpage. During the installation process WinAVR offers a folder name containing |
| C:\WinAVR | C:\WinAVR | ||
| Line 19: | Line 19: | ||
| **3. HomeLab library** | **3. HomeLab library** | ||
| - | HomeLab library is a set of functions designed for HomeLab | + | HomeLab library is a set of functions designed for HomeLab |
| **4.. Virtual COM port driver** | **4.. Virtual COM port driver** | ||
| Line 27: | Line 27: | ||
| {{ : | {{ : | ||
| - | According to number of virtual ports defined | + | According to number of virtual ports previously |
| ===== Creating new project ===== | ===== Creating new project ===== | ||
| - | Writing | + | In order to write a program for the controller you need to create the project space. The project includes typically |
| Following steps have to be completed when creating new project with the help of wizard. | Following steps have to be completed when creating new project with the help of wizard. | ||
| Line 37: | Line 37: | ||
| **1.** Open AVR Studio and press //New Project//. If the dialog box is not opened automatically select //Project - New project// from the menu bar. Press //Next//. | **1.** Open AVR Studio and press //New Project//. If the dialog box is not opened automatically select //Project - New project// from the menu bar. Press //Next//. | ||
| - | {{ : | + | {{ : |
| - | **2.** | + | **2.** |
| - | NB! Kui kompilaatori valikus puudub | + | NB! If AVR GCC is missing on the compiler list, it is not properly installed. In that case the WinAVR |
| - | {{ : | + | {{ : |
| - | **3.** | + | **3.** |
| - | {{ : | + | {{ : |
| - | **4.** | + | **4.** |
| {{ : | {{ : | ||
| - | **5.** | + | **5.** |
| - | {{ : | + | {{ : |
| - | **6.** | + | **6.** |
| - | {{ : | + | {{ : |
| - | Kui objekt | + | If object |
| - | ===== Seadistuste testimine | + | ===== Setting' |
| - | Kui arenduskeskkond on esimest korda paigaldatud ja seadistatud, on mõistlik testida, kas kõik sai tehtud õigesti. Selleks on lihtsaim viis teha üks väike programm, see ära kompileerida ja laadida kontrollerisse. | + | After set up of the development environment it is wise to test it, for ensuring its correctness. Simplest way is to write a short program, compile it and upload to controller. |
| - | **1.** | + | **1.** |
| + | |||
| + | Insert simple | ||
| <code c> | <code c> | ||
| Line 75: | Line 77: | ||
| int main(void) | int main(void) | ||
| { | { | ||
| - | // Viigu PB7 seadmine väljundiks | + | // Pin PB7 to output |
| DDRB = 0x80; | DDRB = 0x80; | ||
| - | // Lõputu tsükkel | + | // Endless cycle |
| while (true) | while (true) | ||
| { | { | ||
| - | // Viigu PB7 inverteerimine | + | // Pin PB7 invertion |
| PORTB ^= 0x80; | PORTB ^= 0x80; | ||
| hw_delay_ms(500); | hw_delay_ms(500); | ||
| Line 88: | Line 90: | ||
| </ | </ | ||
| - | [{{ : | + | [{{ : |
| - | Kompileerida programm käsuga | + | Compile the project with // |
| + | < | ||
| Build succeeded with 0 Warnings... | Build succeeded with 0 Warnings... | ||
| + | </ | ||
| - | **2.** | + | **2.** |
| - | {{ : | + | {{ : |
| - | Kui eespool toodud aken ei avane ja avaneb aken // | + | If the described window does not open and // |
| - | {{ : | + | {{ : |
| - | **3.** | + | **3.** |
| OK | OK | ||
| Line 114: | Line 118: | ||
| Leaving programming mode.. OK | Leaving programming mode.. OK | ||
| - | Prorammi mõjul peaks kontrolleri plaadil olev LED PB7 perioodiliselt süttima ja kustuma. Kui programm töötab, on tarkvara paigaldatud edukalt ja esimene projekt tehtud. Palju õnne! | + | According to the program the on-board |
| {{: | {{: | ||
| - | ===== Siluri kasutamine | + | ===== Debugger |
| - | [{{ : | + | [{{ : |
| - | Programmi silumiseks (inglise keeles // | + | Debugging a program means searching errors from the program. For that programs called debuggers are created, they allow to execute the program step by step and stopping it where it is needed. Such implementation of the program allows checking the values of the variables at any phase of the program, contents of the registers and the sequence of executing the program. Debugging is especially important while dealing with more complex programs where it is often difficult to find errors. With microcontrollers, it is important that step-by-step implementation of program is done in the controller, which allows seeing change of real outputs in addition to the values of the registers. Two conditions must be met for using a debugger: microcontroller must support debugging and you must have necessary hardware – JTAG programmer which allows debugging. Cheaper programmers using ISP programming interface may upload compiled program into the controller but not necessarily allow debugging. |
| + | |||
| + | To start the program in debugging mode with the AVR Studio, firstly it should be compiled by pressing button //build// (F7) and the compiled program started with the command //Run// (F5). Before that //break points// (F9) can be added to selected palces in the source code. When implementation of the program reaches the break point, the program is stopped for determining the state of the microcontroller in that point. Implementation of the program may be continued with command //Run// again or use //Step Into// (F11) for implementing the program one command at the time. | ||
| - | Programmi käivitamiseks siluri režiimis AVR Studio-ga tuleks see esmalt kompileerida nupuga //Build// (kiirklahv F7) ja käivitada kompileeritud programm käsuga //Run// (kiirklahv F5). Programmi lähtekoodi võib enne seda soovitud kohtadele lisada katkestuspunkte (inglise keeles //break point//) (kiirklahv F9). Kui programmi täitmine jõuab katkestuspunktini, | ||
| - | ===== Ujukoma-arvude kasutamine | + | ===== The usage of floating-point variables |
| - | Mõnikord tekib vajadus | + | Some times in AVR program it is necessary to use floating-point variables. For calculating with them and presenting with //printf//-type functions, the following set-up changes must be done to the configuration of the project: |
| - | **1.** | + | **1.** |
| - | **2.** | + | **2.** |
| - | **3.** | + | **3.** |
en/examples/setup/windows.1265290259.txt.gz · Last modified: (external edit)
