Advertisement
artones

Untitled

Mar 22nd, 2021
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. #include "C8051F120.h"
  3. sbit SW=P3^7;
  4. sbit LED=P1^6;
  5. int i=0;
  6. void Reset_Sources_Init()
  7. {
  8. WDTCN = 0xDE;
  9. WDTCN = 0xAD;
  10. }
  11. void Port_IO_Init()
  12. {
  13. SFRPAGE = CONFIG_PAGE;
  14. P1MDOUT = 0x40;
  15. XBR2 = 0x40;
  16. }
  17. void Init_Device(void)
  18. {
  19. Reset_Sources_Init();
  20. Port_IO_Init();
  21. }
  22. void main (void)
  23.     {
  24.         Init_Device(); 
  25. while(1)
  26. {
  27.     LED = 0;
  28. for (i =0; i<=196607;i++) {
  29. LED =~ LED;
  30.   }
  31.  
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement