# How to convert Clock signal to PWM signal?

Let's say i have a clock signal which i control its frequency making it going from 10Hz to 1000Hz. And i want to convert this to PWM signal, so that 10Hz gives 0% duty cycle and 1000Hz gives 100% duty cycle.
How can i make such conversion?

Note: What i'm trying to do in reality is control a DC motor with a Stepper motor driver, The stepper motor driver output Dir and Pulsation signals, and i want to take the pulsation signal (that varies in frequency according to speed) and use it to control the DC motor.

• Have you taken a look in 555 timer circuit that generates pwm signal . Also you may need a closed loop controller and dc motor with encoder to replace the stepper motor functionalty exactly. Commented Jan 26, 2016 at 9:56
• Is this linear with frequency or logarithmic with frequency? At the midpoint frequency (say 100 Hz) are you wanting your 100 Hz input clock to be exactly a 100 Hz 50% duty output clock i.e. no change or are you wanting your input frequency only to set the duty cycle of some arbitrary frequency that is not connected? Is your input duty cycle 50% or might this vary? Commented Jan 26, 2016 at 10:00
• @ElectronS I know that 555 timer can output a PWM signal, but i need a way to convert the clock signal i have to maybe some voltage level and then feed it to the timer. Commented Jan 26, 2016 at 12:45
• @Andyaka No it's not logarithmic, i want it to be proportional, so varying frequencies will produce varying duty cycles. Commented Jan 26, 2016 at 12:47
• At what target PWM frequency (the same as the input frequency or fixed at some other value)? Commented Jan 26, 2016 at 13:51