started with:
void setup()
{
// put your setup code here, to run once:
pinMode(3, OUTPUT);
pinMode(11, OUTPUT);
TCCR2A = _BV(COM2A0) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);
TCCR2B = _BV(WGM22) | _BV(CS22);
OCR2A = 180;
OCR2B = 50;
Serial.begin(9600);
}
and looping from 0 to 360 in loop(), only used analogWrite(3, 100);
last night I got something from pin 11, but today got nothing from pin 11.
pin 11 was never used in loop(), it use in setup() was only because of cut and paste.
from TCCR2A = _BV(COM2A0) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);
i printed the value of COM2A0, COM2B1, WGM21, and WGM20, which gave values of 0,5,7, and another single digit.
so, i made four nested for loops to test values in the four _BV().
i stopped at about 0,4,14,20 because i was only getting frequencies of 0.000 Hz, 489.8 Hz, and 975.9 Hz
i have looked though pages for what _BV() does or what the perams are or something to explain how to change the frequencies.
is there a page that explains _BV()? if so, where is it? if not, why does it not exist?
o, i also changed OCR2A value from 0 to 360 and did not change the frequency.