You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
368 B

4 years ago
  1. /*
  2. * File: newmain.c
  3. * Author: dev
  4. *
  5. * Created on March 23, 2020, 11:48 PM
  6. */
  7. #include <xc.h>
  8. #include <avr/io.h>
  9. #include <util/delay.h>
  10. int main(void)
  11. {
  12. //Write CCP
  13. CCP = 0xD8;
  14. //change CLK to 128KHz
  15. CLKMSR = 0b01;
  16. // PB2 output
  17. DDRB = 1<<2;
  18. while(1)
  19. {
  20. // Toggle PB2
  21. PINB = 1<<2;
  22. //_delay_ms(500);
  23. }
  24. }