Created
September 1, 2013 04:08
-
-
Save davecheney/6402283 to your computer and use it in GitHub Desktop.
Experimenting with high frequency PWM output from an Atmel328P.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // the setup routine runs once when you press reset: | |
| void setup() { | |
| pinMode(3, OUTPUT); | |
| pinMode(11, OUTPUT); | |
| TCCR2Af = _BV(COM2A0) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20); | |
| TCCR2B = _BV(WGM22) | _BV(CS20); | |
| OCR2A = 1; | |
| OCR2B = 254; | |
| } | |
| void loop() { | |
| // HiZ>f | |
| // AUX Frequency: 4,005,632 Hz | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment