artones

Untitled

Mar 22nd, 2021 (edited)
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 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(){
  23. Reset_Sources_Init();
  24. Port_IO_Init();
  25. Init_Device();
  26. while(1){
  27. LED=~Sw;
  28. }
  29. }
Add Comment
Please, Sign In to add comment