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.

22 lines
325 B

4 years ago
  1. #include <xc.h>
  2. #include <avr/io.h>
  3. #include <util/delay.h>
  4. int main(void)
  5. {
  6. //Write CCP (to enable changing clock)
  7. CCP = 0xD8;
  8. //change CLK to 128KHz
  9. CLKMSR = 0b01;
  10. // PB2 change to output
  11. DDRB = 1<<2;
  12. while(1)
  13. {
  14. // Toggle PB2 Hi/Low
  15. PINB = 1<<2;
  16. //_delay_ms(500);
  17. }
  18. }