PWM Code to for mosfet gate

I am using proteus simulator and simullde and both not showing the right Freq