Hi need help for pwm in 300khz 500khz pwm with variable duty.

Aliaj00:
i wanted the pwm to be part of a variable boost converter that i am trying to figure out

It is the wrong approach to the project. Don't use a processor at all. This is a job for a very cheap dedicated switching circuit rather than a very expensive embedded processor.
The only thing you will learn is that this is the wrong approach.