SHARE
TWEET

Untitled

a guest Feb 27th, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;
  2. ; uppgift 1.asm
  3. ;
  4. ; Created: 2020-02-27 08:37:57
  5. ; Author : eko15lj1
  6. ;
  7.  
  8. #define DDRB    0x04
  9. #define PORTB   0x05
  10. #define LED0    0
  11.  
  12. ; Replace with your application code
  13. start:
  14.     ldi r18, (4 << LED0)
  15.     in r17, DDRB
  16.     or r17, r18
  17.     out DDRB, r18
  18.  
  19.     in r17, PORTB
  20.     or r17, r18
  21.     out PORTB, r18
  22.  
  23.     ; 5hz
  24.     /* ldi r19, 9
  25.     ldi r20, 30
  26.     ldi r21, 229*/
  27.     ;1hz
  28.     ldi r19, 41
  29.     ldi r20, 150
  30.     ldi r21, 128
  31.     call L1
  32.    
  33.     ldi r18, (LED0 << 8)
  34.     out PORTB, r18
  35.    
  36.     ; 5hz
  37.     /* ldi r19, 9
  38.     ldi r20, 30
  39.     ldi r21, 229*/
  40.     ;1hz
  41.     ldi r19, 41
  42.     ldi r20, 150
  43.     ldi r21, 128
  44.     call L1
  45.     rjmp end
  46.  
  47.     L1:
  48.         dec r21
  49.         brne L1
  50.         dec r20
  51.         brne L1
  52.         dec r19
  53.         brne L1
  54.         ret
  55.  
  56.     end:
  57.         rjmp start
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top