Not all pins are capable of producing PWM that might be your problem.
Otherwise post you schematic and code.