OpenCores
no use no use 1/1 no use no use
Reading PWM
by rjberry on Oct 15, 2015
rjberry
Posts: 2
Joined: Aug 21, 2015
Last seen: Oct 16, 2015
Hi,
I am new to verilog and am looking for code to read a PWM singal coming from a sensor.
can anyone help me?
Best Regards,
Rob Berry
RE: Reading PWM
by hellwig on Oct 16, 2015
hellwig
Posts: 32
Joined: Dec 30, 2007
Last seen: Nov 3, 2024
Hi Rob,

what does "read" in your question mean exactly? I assume that the signal
is already a digital signal and has the appropriate amplitude for your
accepting circuit (an FPGA?). Most likely, it will be asynchronous to your
circuit's clock, so you have to synchronize it. The standard two flip-flop
synchronizer will perhaps do. What is the basic frequency of your PWM signal?
Is it significantly lower than your clock frequency? Then "reading" could
mean "count the clock cycles in which the signal is high/low".

Hellwig
RE: Reading PWM
by rjberry on Oct 16, 2015
rjberry
Posts: 2
Joined: Aug 21, 2015
Last seen: Oct 16, 2015
Hi,
Thanks for the reply. here is all I know about the PWM signal is 10usec step size.
I agree it need to synchronized with the clock. I did find a PWM_Reader sample on this site but cant get it to work. I must be doing something wrong. I appreciate the help. I am new to Verilog and am learning allot every day.
The code I am trying to get to work is located here:
www.OPENCORES.com/serial_div_uu/web_uploads/pwm_reader.v

Thanks!
Rob
RE: Reading PWM
by dgisselq on Oct 28, 2015
dgisselq
Posts: 247
Joined: Feb 20, 2015
Last seen: Oct 24, 2024

Is this the code you are trying to work with?

What problems are you having?

Dan

no use no use 1/1 no use no use
© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.