Advertisement
artones

Untitled

Mar 31st, 2021
301
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. ORG 000Bh;                 
  7. AJMP T0_ISR
  8. ; Peripheral specific initialization functions,
  9. ; Called from the Init_Device label
  10. Reset_Sources_Init:
  11. mov WDTCN, #0DEh               
  12. mov WDTCN, #0ADh
  13. ret
  14. Timer_Init:
  15. mov SFRPAGE, #TIMER01_PAGE 
  16. mov TMOD, #01h;            
  17. ret
  18. Port_IO_Init:
  19. mov SFRPAGE, #CONFIG_PAGE      
  20. mov P1MDOUT, #040h
  21. mov XBR2, #040h
  22. ret
  23. Interrupts_Init:
  24. mov IE, #082h;             
  25. ret
  26. Init_Device:
  27. lcall Reset_Sources_Init       
  28. lcall Port_IO_Init
  29. lcall Timer_Init
  30. lcall Interrupts_Init
  31. ret
  32. T0_ISR:                
  33. CLR TF0;                   
  34. RETI;                      
  35. MAIN:
  36. CALL Init_Device;
  37. MOV R0, #10h
  38. setb TR0
  39. IDLE:  
  40. ORL PCON, #01h;            
  41. DJNZ R0, IDLE;
  42. MOV R0, #10h;
  43. CPL LED;
  44. JMP IDLE;
  45. END
Advertisement
RAW Paste Data Copied
Advertisement