ATtiny analog pins - best practice

groundFungus:
PWM uses the analogWrite() function.

Of course... :cold_sweat:

groundFungus:
I would just use analogRead() and analogWrite() unless there is a compelling reason to use the registers (ie speed faster than 100us for a read or changing PWM frequency).

"Best practice" is hard to define without knowing, in detail, what you are trying to do.

As i'm changing the pwm frequency to 20KHz, i have to use registers. The pwm-signal is used to control a 4-pin dc fan.
So, would you write to TCCR1 and use analogWrite() along or stick to writing to registers?

Is there any significant difference in using the Arduino functions over writing to registers or even mixing both up?

Thanks and regards!

Philipp