You are on page 1of 1

ENEL3DSH1 Digital Systems 2020

Tutorial Two
Part One: The IDE

We did a walkthrough of the IDE…

Part Two: My first program…


We also introduced the concept of a delay loop and the need for visualisation delays…
;
; Tut2.asm
;
; Created: 2020/02/15
; Author : Ray

init:
ldi r16,0xFF
out DDRA,r16
start:
inc r16 ;label: pneumonic destination, source
out PORTA,r16 ;write the value in r16 to port A pin

delay1:
inc r17 ;first delay loop
brne delay1

delay2:
inc r17 ;second delay (you may need about 20 delay loops!)
brne delay2 ;Can you nest the first loop inside an outer loop that
;runs 20 times?

rjmp start

You might also like