This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:exercisesbook:avr:sut:scenarios:avr1 [2026/05/02 12:11] – pczekalski | en:multiasm:exercisesbook:avr:sut:scenarios:avr1 [2026/05/03 19:19] (current) – pczekalski | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| In this scenario, you will implement a classical "Hello World" application. For microcontrollers, | In this scenario, you will implement a classical "Hello World" application. For microcontrollers, | ||
| - | ** Target group **\\ | ||
| - | This scenario is for beginners. | ||
| ** Prerequisites **\\ | ** Prerequisites **\\ | ||
| Line 12: | Line 10: | ||
| ** Result **\\ | ** Result **\\ | ||
| - | Observe flashing | + | Flashing |
| ** Start **\\ | ** Start **\\ | ||
| Mind to use AVR GCC syntax (as in the instruction): | Mind to use AVR GCC syntax (as in the instruction): | ||
| - | ** Step 0 **\\ | + | ** Step 1 **\\ |
| Compose an empty application with an infinite loop: | Compose an empty application with an infinite loop: | ||
| <code asm> | <code asm> | ||
| Line 30: | Line 28: | ||
| Compile and check for any errors. Correct errors (if any), re-compile, and upload to the device. Naturally, nothing will happen now: your code is dummy, but you will ensure proper toolkit operation. | Compile and check for any errors. Correct errors (if any), re-compile, and upload to the device. Naturally, nothing will happen now: your code is dummy, but you will ensure proper toolkit operation. | ||
| - | ** Step 1 **\\ | + | ** Step 2 **\\ |
| Add to your code declarations regarding GPIO control ports for GPIO 13: | Add to your code declarations regarding GPIO control ports for GPIO 13: | ||
| <code asm> | <code asm> | ||
| Line 39: | Line 37: | ||
| </ | </ | ||
| - | ** Step 2 **\\ | + | ** Step 3 **\\ |
| Configure GPIO 13 for output: | Configure GPIO 13 for output: | ||
| <code asm> | <code asm> | ||
| Line 49: | Line 47: | ||
| </ | </ | ||
| - | ** Step 3 **\\ | + | ** Step 4 **\\ |
| Prepare your delay function and place it at the end of the code (after 'rjmp LOOP' | Prepare your delay function and place it at the end of the code (after 'rjmp LOOP' | ||
| <code asm> | <code asm> | ||
| Line 69: | Line 67: | ||
| </ | </ | ||
| - | ** Step 4 **\\ | + | ** Step 5 **\\ |
| Implement the main loop: | Implement the main loop: | ||
| <code asm> | <code asm> | ||
| Line 86: | Line 84: | ||
| ** FAQ **\\ | ** FAQ **\\ | ||
| - | When using the printed version of this manual, please refer to the latest online version of this document to obtain the most up-to-date list of FAQs. | + | When using the printed version of this manual, please refer to the latest online version of this document to obtain the most up-to-date list of FAQs.\\ |
| **It does not flash**: Did you compile and upload to the device? Those are separate steps: it is not enough to just compile, but you also need to " | **It does not flash**: Did you compile and upload to the device? Those are separate steps: it is not enough to just compile, but you also need to " | ||
| + | |||
| + | **I need a longer delay**: To obtain a delay function with a period of about 2.5s, you need to introduce a fourth loop (an outer loop) in the delay; 3 will not provide you enough ticks. Eventually, you can switch to 16-bit counters. | ||
| // | // | ||