Changing analogWrite() function frequency

If you don't want to maipulate registers yourself, you can try out my FastPwmPin library. I made it when I needed high frequency PWM. It supports various popular Atmel processors, including the ATmega328.

(See the readme for details such as used timers, supported pins, etc.)