Skip to content

Instantly share code, notes, and snippets.

@jgrahamc
Created September 18, 2022 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgrahamc/dd6a0c7abb35ff92990a2c7de4ce3abe to your computer and use it in GitHub Desktop.
Save jgrahamc/dd6a0c7abb35ff92990a2c7de4ce3abe to your computer and use it in GitHub Desktop.
Added 8Mhz clock on pin 9 to ArduinoISP
74c74
< #define LED_HB 9
---
> // #define LED_HB 9
96c96
< #define LED_HB 7
---
> // #define LED_HB 7
231,232c231,241
< pinMode(LED_HB, OUTPUT);
< pulse(LED_HB, 2);
---
> // pinMode(LED_HB, OUTPUT);
> // pulse(LED_HB, 2);
>
> pinMode(9, OUTPUT);
> // setup high freq PWM on pin 9 (timer 1)
> // 50% duty cycle -> 8 MHz
> OCR1A = 0;
> ICR1 = 1;
> // OC1A output, fast PWM
> TCCR1A = _BV(WGM11) | _BV(COM1A1);
> TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // no clock prescale
279c288
< analogWrite(LED_HB, hbval);
---
> // analogWrite(LED_HB, hbval);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment