PWM and Frequency control problem

  1. Do you have external pull up or pull-down resistors connected with your inputs?
    http://www.cmiyc.com/tutorials/arduino-pull-ups/

  2. Why aren't you using analogWrite()?