No idea. But you might try printing the value of pwm before the analogWrite to see what's going on.
-br