I'm using and arduino micro (ATmega 32U4) to control a DC motor via a motor driver. I would like to increase the PWM output frequency (standard 953.2Hz I think). In the documentation for the 32U4 I see that PB6 (D10 on micro) can be used on timer 1 (OC1B) or timer 4 (OC4B). from my testing it seems that PB6 is controlled by timer 1 as standard and I have successfully changed the PWM output frequency by changing the clock select bits. Now I Would like to know how i can change PB6 to be controlled by timer 4. I want to use timer 4 since timer 0 and 1 are used for other things that i will need for my project and i don't want to affect any timing there. Also Timer 4 has more granularity to change the clock select.
TLDR: how to control PB6 on a ATmega 32U4 by timer 4 (OC4B) instead of timer 1 (OC1B).
Yes, that is where i found that PB6 can be used on timer 1 or timer 4 (if i understood the documentation correctly). But i can't find how to choose which timer.
You don't. Simply set up Timer4 to produce PWM with the desired characteristics on the output pin, although it would be easier use Timer3 instead, which is equivalent to Timer1.
Timer 3 could indeed be a easier option, but that one doesn't have the same granularity in clock select that timer 4 does.
You mean the registers that I have to write to instead of timer 1? I don't think I have to change anything else, besides the usual for timer1, if I use PC6 with timer 3 since that seems to be the only pin on that timer and is as standard the output for that timer.