Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to detect a PWM signal to catch the duty percentage?

Status
Not open for further replies.

nemolee

Full Member level 3
Joined
Dec 28, 2004
Messages
155
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,298
Activity points
1,467
PWM signal detection

Dear Sir,

Right now, I have to detect a PWM signal to catch the duty percentage.
The input PWM signal is work at 160Hz frequency.
And I have to output another PWM signal work at 240Hz freqency.
The output duty ratio is the same as 160Hz input PWM.
How should I do??

Thanks
 

Re: PWM signal detection

Dear sir :)

How should I do??

I believe PIC microcontrollers with a 'CCP' module can perform that task. It stands for 'capture, compare, PWM'. It can be used to generate PWM, or analyse the duty cycle of external signals (ie: measure your incoming PWM). I'm just starting to realise the applications for this, it relaly is quite useful. ALso, there are many PIC devices that have this peripheral, and they're cheap :D

You could use it to accurately measure the period of the PWM signal, and then, as long as the period remains constant, you then use this value to measure the duty cycle (ie: ON time).

Or....you could read in software. If you know for a fact that the PWM signal is 160Hz, and fixed. Then its just a case of using timers, with the appropriate pre/post scalers.
Example: Wait for 'rising edge'. Then start timer, wait for falling edge. stop the timer. THis will give you 'how long' the ON time was. Because you know the period, you can now calculate the PWM. Its thena case of using the PIC's CCP module to produce a new PWN signal, at 240Hz. :D

It sounds really complicated, but taken in stages, it shouldn't be that hard. And...there are many ways to do, some using dedicated hardware, or all in software. Thankfully..the signals you are dealing with a fairly low frequency. If you wish to use a microcontroller JUST for this task, its easy :)

Hope this helps in 'some' way.

BuriedCode.
 
  • Like
Reactions: asking

    asking

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top