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:avr2 [2026/05/03 19:23] – pczekalski | en:multiasm:exercisesbook:avr:sut:scenarios:avr2 [2026/05/03 19:35] (current) – pczekalski | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== AVR2: Create | + | ====== AVR2: Create |
| In this scenario, you will implement a pattern using multiple LEDS. There are 4 LEDs connected to GPIOs 13, 12, 11, and 10 (D1 on top is GPIO 13; D4 at the bottom is GPIO 10). In this scenario, you will use blocking nested loops and manual calculation of the ticks needed to run them, to obtain precise '' | In this scenario, you will implement a pattern using multiple LEDS. There are 4 LEDs connected to GPIOs 13, 12, 11, and 10 (D1 on top is GPIO 13; D4 at the bottom is GPIO 10). In this scenario, you will use blocking nested loops and manual calculation of the ticks needed to run them, to obtain precise '' | ||
| Line 55: | Line 55: | ||
| reset: | reset: | ||
| - | ; 1. Initialise Stack Pointer using hi8 and lo8 functions | + | ; Initialise Stack Pointer using hi8 and lo8 functions |
| ldi r16, lo8(RAM_END) | ldi r16, lo8(RAM_END) | ||
| out SPL, r16 | out SPL, r16 | ||
| Line 65: | Line 65: | ||
| Configure GPIO13 <-> GPIO10 as outputs. Note, we do it in a bunch, not individually, | Configure GPIO13 <-> GPIO10 as outputs. Note, we do it in a bunch, not individually, | ||
| <code asm> | <code asm> | ||
| - | ; 2. Configure GPIO: Set PB2-PB5 as outputs | + | ; Configure GPIO: Set PB2-PB5 as outputs |
| ldi r16, LED_MASK | ldi r16, LED_MASK | ||
| out DDRB, r16 | out DDRB, r16 | ||
| Line 97: | Line 97: | ||
| ** FAQ **\\ | ** FAQ **\\ | ||
| - | When using the printed version of this manual, please refer to the latest online version | + | When using the printed version of this manual, please refer to the latest online version |
| **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 " | ||