Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:multiasm:exercisesbook:avr:sut:scenarios:avr2 [2026/05/03 19:23] pczekalskien:multiasm:exercisesbook:avr:sut:scenarios:avr2 [2026/05/03 19:35] (current) pczekalski
Line 1: Line 1:
-====== AVR2: Create an LED pattern ======+====== AVR2: Create live LED pattern ======
 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 ''delay'', as presented in the chapter [[..:..:..:arduinouno|]]. You will use binary operations to control the GPIOs and to drive them in parallel.\\ 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 ''delay'', as presented in the chapter [[..:..:..:arduinouno|]]. You will use binary operations to control the GPIOs and to drive them in parallel.\\
  
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, thus instead of setting individual bits in ''DDRB'', it is easier to write a proper bit mask (''LED_MASK''): Configure GPIO13 <-> GPIO10 as outputs. Note, we do it in a bunch, not individually, thus instead of setting individual bits in ''DDRB'', it is easier to write a proper bit mask (''LED_MASK''):
 <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 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 for 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 "flash" the MCU. Also, check your video stream if it "ticks" - the time embedded into the video stream should change. Your code may be working OK, but the video stream can be frozen, so you cannot see it working properly! **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 "flash" the MCU. Also, check your video stream if it "ticks" - the time embedded into the video stream should change. Your code may be working OK, but the video stream can be frozen, so you cannot see it working properly!
en/multiasm/exercisesbook/avr/sut/scenarios/avr2.1777825436.txt.gz · Last modified: by pczekalski
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0