Advertisement
artones

Untitled

Mar 22nd, 2021
292
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $NOMOD51
  2. $include (C8051F120.h)
  3. LED BIT P1.6;
  4. CSEG AT 0;
  5. LJMP MAIN;
  6. Reset_Sources_Init:
  7. mov WDTCN, #0DEh ;
  8. mov WDTCN, #0ADh
  9. ret
  10. Port_IO_Init:
  11. mov SFRPAGE, #CONFIG_PAGE ;
  12. mov P1MDOUT, #040h
  13. mov XBR2, #040h
  14. ret
  15. ; Initialization function for device,
  16. ; Call Init_Device from your main program
  17. Init_Device:
  18.     lcall Reset_Sources_Init
  19.     lcall Port_IO_Init
  20.     ret
  21. MAIN:
  22.     CALL Init_Device;
  23.     CLR LED;
  24.    
  25. LED = 0;    ?????????? ??????????
  26. mov R5, #00h;
  27. LOOP:
  28. mov R7, #03h; R7, R6, R5 – ???????? ????? ?????????? ????????? ??????
  29. DELAY:
  30. mov R6, #00h; ????????
  31. LOOP1:
  32. djnz R5,$;
  33. djnz R6, LOOP1;
  34. djnz R7, DELAY;
  35.  
  36. mov C, SW; ??????????? ?????? ? ??????????
  37. cpl c;
  38. mov LED, C;
  39. sjmp LOOP;
  40.  
  41. End
  42.  
Advertisement
RAW Paste Data Copied
Advertisement