Advertisement
patryk

Dioda-Timer

Mar 29th, 2015
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. org 00H
  2. JMP start
  3.  
  4. org 03H
  5. JMP switch
  6.  
  7. org 1BH
  8. JMP full
  9.  
  10. full:
  11.     INC R3
  12.     MOV TL1, #0
  13.     MOV TH1, #0
  14.     ANL TCON, #01111111b
  15.     RETI
  16.  
  17. switch:
  18.     MOV R3, #0
  19.     MOV TMOD, #00010000b
  20.     MOV TCON, #01000000b
  21.  
  22.     loop:
  23.         MOV A, R3
  24.         CJNE A, #5, loop
  25.  
  26.     JB P3.2, return
  27.  
  28.     CPL P3.4
  29.     MOV TCON, #0
  30.     MOV TMOD, #0
  31.     MOV TL1, #0
  32.     MOV TH1, #0
  33.    
  34.     return:
  35.         RETI
  36.  
  37. start:
  38.     MOV IE, #10000001b
  39.     SETB IP.3
  40.     sjmp $
  41.  
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement