PWM frequency adjustment

Hey guys,

I am trying to set up two fans and control their speed using PWM and monitor that speed using interrupts. The issue I have found is the fans require a PWM signal at 25 kHz, which means I have to change the frequency on the pins that I am using to control the fan speed. To do this, I have to play with the timers on those pins. I have been able to control the speed of one fan on both pin 3 (timer2) and pin 5 (timer0), but pin 3 is being used for an interrupt (only 2 and 3 can accept interrupts on the UNO) and messing with timer0 seems to affect the serial output somehow because I am unable to get an output when I change that timer. That leaves only pins 9 and 10 (timer1) to control the fans. Luckily, this can supposedly be done using ICR1 as TOP and changing the values of OCR1A and OCR1B to obtain the desired duty cycle, but I have been unable to figure out how. Here is the code I am using to change the frequency on the timer and setup the duty cycles:

void setup()
{
  Serial.begin(9600);
  TCCR1A = 0x23;
  TCCR1B = 0x09;  // select clock
  ICR1 = 79;  // aiming for 25kHz
  pinMode(controlPin, OUTPUT);  // enable the PWM output (you now have a PWM signal on digital pin 3)
  OCR1A = 40;  // set the PWM duty cycle
  OCR1B = 40;
}

This code was originally made to be used with timer 2. I suspect the problem has something to do with timer1 being 16 bits while timer0 and timer2 are only 8 bits, but I don't know how to do the math to adjust for that. Any help would be greatly appreciated. Thanks in advance!