For atmega328p ,there are only 6 pins that have the function of pwm. PWM is basically oscillating the pin high to low where the width of the high pulse decides the value of the signal. This can also be done manually by keeping the pin high for few microseconds and then low for some more microseconds. I tried controlling a pwm servo from a non pwm pin using this logic and it worked. So now coming to the question, if high and low is what is there to pwm then why is it only limited to 6 pins. All the I/O pins of atmega328p should have the pwm facility but why only 6 have this facility? What makes these 6 pins so special?