I was reading http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM
Am I correct in reading that if I write my own PWM routine, I don’t have to be limited by 255 resolution?
AnalogWrite(127) is about 50% duty cycle, and each increment has a resolution of 1/256. If I want a higher resolution, like 1024 can I just write a loop that counts up to 1024, setting the outputpin high and low depending where I am in the loop without suspending other operations (math, interrupts,…)? There is an example in the community code section for timer/pwm routines.
Finally, were are the ports defined such as these:
TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM20);
TCCR2B = _BV(CS22);
OCR2A = 180;
OCR2B = 50;