Generating 0~3Mhz with pwm

Hi guys.
I need some help
I want to generate 0~3 Mhz pulse with duty rate 50% for my steppingmotor driver.
And i read "secret of PWM"
I need two parts that generate 0~3Mhz for my steppingmotor driver cause I want the steppingmotor driver to run two motors

For full step drive (always 50% duty cycle), you will need 4 synchronized output signals, e.g. PWMH0, PWML0, PWMH1, PWML1. Synchronize your 4 PWM signals by using PWM_SMMR register in 2-bit gray code. PWMH0 frequency will automatically monitor the 3 others, providing PWM channels 0 and 1 have been previously enabled.

Note that you can do the same for PWMH2, PWML2, PWMH3, PWML3 (second stepper motor).

See this thread for some more explanations:
http://forum.arduino.cc/index.php?topic=462272.0

Umm thanks to ard_newbie
i think need more explain.
My steppingmotor driver request 0~3Mhz(0~18000Rpm) to setting speed of steppingmotor.
Forexample i send to motordriver 300000hz(duty rate 50%) then motor will spin 1800RPM.
that's why i wrote the question about generating 0~3mhz.
exctually i need 0.3Mhz but if i use 10Microstep then may be i needed.

You should begin by learning and understanding how works a stepper motor. There are numerous relevant tutorials for that.

Micro stepping is not Full stepping. For micro stepping, you will need the PWM synchro feature and e.g. 16 steps for each period. See this thread, reply 6:

http://forum.arduino.cc/index.php?topic=537904.msg3692270#msg3692270

Ofcourse i know about how microstep moves.
what i want is how to generate 0~3mhz (duty rate50%).
mine only needs pulse to run. also i know about speed profiles.

See this thread, reply #4 for an overall PWM programming :
https://forum.arduino.cc/index.php?topic=396125.0

Oh assume what i want.
have a question about codes.
in loop i made the function of control hz?
can alloc another pin to generate another hz?
i understand your code generate one pulse.

DrVoid:
in loop i made the function of control hz?
can alloc another pin to generate another hz?

Yes and yes.

Very Thank you to ard_newbie
Really helpful.
Some of my friends say it is hard to write code.