Duty cycle to frequency

Thread Starter

Tobias

Joined May 19, 2008
158
I need to measure an incoming PWM and convert it to a specific frequency.
460hz/1% duty cycle.

I am going the PIC route now. I am learning about how to config the timers to get a frequency. I am getting there but curious if there are other options to this project.
 

tom66

Joined May 9, 2009
2,595
You could divide the frequency by two. This would give you 230 Hz at 50% duty which is much easier to measure using a small microcontroller.
 

strantor

Joined Oct 3, 2010
6,798
If I understand OP correctly, the idea is to take a PWM input signal of 0-100% and convert it to a variable frequency AC signal of 0-460Hz
 

tom66

Joined May 9, 2009
2,595
If I understand OP correctly, the idea is to take a PWM input signal of 0-100% and convert it to a variable frequency AC signal of 0-460Hz
Voltage to frequency converter?

(With voltage being the result of the PWM being filtered.)

Problem is, I know no V-F converters that go down to 0 Hz... most are 10 or 1 Hz.
 

Thread Starter

Tobias

Joined May 19, 2008
158
Incoming PWM is 1000hz.
I want to equate the duty cycle of the PWM into a frequency.
For every 1% duty cycle is 460 hz.
So 1% is 460 hz
50% is 23000
100% is 46000

I am not stuck with the mentioned calibration.
 

Thread Starter

Tobias

Joined May 19, 2008
158
I was thinking the V-F route, yet the amplitude of the PWM might vary with battery level.


Voltage to frequency converter?

(With voltage being the result of the PWM being filtered.)

Problem is, I know no V-F converters that go down to 0 Hz... most are 10 or 1 Hz.
 

strantor

Joined Oct 3, 2010
6,798
wait, so you are trying to accomplish this with a PIC? IE have the pwm signal go into the pic, pic reads the duty cycle, then pic outputs the frequency?
so are you looking for code?
 

tom66

Joined May 9, 2009
2,595
I was thinking the V-F route, yet the amplitude of the PWM might vary with battery level.
If you use a comparator or a logic buffer (two logic inverters in series) then the amplitude will stay constant no matter what the battery voltage is.
 
Top