SHARE
TWEET

Untitled

a guest Jun 12th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  .syntax unified
  2. .set DELAY_INTERVAL,0x186004
  3. .set RCC_AHB1ENR,0x40023830
  4. .set GPIOD_MODER,0x40020C00
  5. .set GPIOD_OTYPER,0x40020C04
  6. .set GPIOD_OSPEEDR,0x40020C08
  7. .set GPIOD_PUPDR,0x40020C0C
  8. .set GPIOD_ODR,0x40020C14
  9. .global diody
  10.  
  11. diody:
  12.  
  13. turnON:
  14.     LDR R1, =GPIOD_ODR
  15.     LDR R0, [R1]
  16.     ORR R0, #0xF000
  17.     STR R0, [R1]
  18.  
  19.     LDR R2, =DELAY_INTERVAL
  20.  
  21. delay1:
  22.     CBZ R2, turnOFF
  23.     SUBS R2, R2, #1
  24.     B delay1
  25.  
  26. turnOFF:
  27.     LDR R1,=GPIOD_ODR
  28.     LDR R0,[R1]
  29.     AND R0,#0xFFFF0FFF
  30.     STR R0,[R1]
  31.  
  32.     LDR R2,=DELAY_INTERVAL
  33. delay2:
  34.     CBZ R2,delayDone
  35.     SUBS R2,R2,#1
  36.     B delay2
  37.  
  38. delayDone:
  39.     B turnON
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