Arduino mega 2560 timers problem

I have a problem with timers on mega 2560 board. When I bought it I tried to write a program for my step motor using PWM.h library which is found here: http://forum.arduino.cc/index.php?topic=117425.0.

Everything went fine so I decided to make a shield with other functions. After maybe 3 months when the shield was in production I tried my old code again to verify if everything is ok but NOT. The PWM output on pin 9 did not start also on other pins except pin 11 where PWM output works fine. But my shield using pin 9 so its quiet bad for me. I know that its possible to rewire it but anyone know why this happens? If I blocked something or etc? I checked the library code and everything seems to be fine. Also the registers. Maybe I updated Arduino IDE but dont know if it can be a problem. I tried a simple code:

InitTimersSafe();
SetPinFrequencySafe(9, 1600);
pwmWrite(9, 128);

Joziff:
I have a problem with timers on mega 2560 board. When I bought it I tried to write a program for my step motor using PWM.h library which is found here: http://forum.arduino.cc/index.php?topic=117425.0.

Everything went fine so I decided to make a shield with other functions. After maybe 3 months when the shield was in production I tried my old code again to verify if everything is ok but NOT. The PWM output on pin 9 did not start also on other pins except pin 11 where PWM output works fine. But my shield using pin 9 so its quiet bad for me. I know that its possible to rewire it but anyone know why this happens? If I blocked something or etc? I checked the library code and everything seems to be fine. Also the registers. Maybe I updated Arduino IDE but dont know if it can be a problem. I tried a simple code:

InitTimersSafe();

SetPinFrequencySafe(9, 1600);
pwmWrite(9, 128);

If your PWM on pin 9 USED to work and now it doesn't - maybe you have a blown MCU? Try another MEGA2560 board to see if it's your code or a bad board?

Also, try simply using "[b]analogWrite (9, xxx)[/b]" without any libraries loaded and see if that works. If it does, then it tells you that the Arduino board is OK and it's a code problem.

If you do need to swap pins around, may I suggest the "Go-Between Shield" from Mayhew Labs (click the image to visit the website):

This is a simple and super-handy board. It simply plugs between your Arduino and any shield. Then you solder the appropriate jumper pads closed - you can route any pin to any pin.

Hope this helps.

Thanks for an answer. I forgot to check if analogWrite functions well but I tried TIMER2 which is on pin 9 to set for CTC and Overflow interrupt and both works well but phase correct pwm does not work. Also the pin can be set digitally high and low. Maybe the MCU problem.