PDA

View Full Version : Duty cycle measurement



Tronic (Greece)
05-25-2006, 01:37 PM
Hello everyone.

Is it possible for basic stamp to measure the duty cycle of a PWM signal and output the HIGH time (T1) as a per cent number (%)?

Is there a limitation of the frequency it can do this kind of measurement?



Thanos

·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Greekbotics: Greek Robotics Forum (http://Greekbotics.knows.it)

Post Edited (Tronic (Greece)) : 5/25/2006 7:06:20 AM GMT

Chris Savage
05-25-2006, 08:53 PM
Hello,

·· Yes, the BASIC Stamp can do this using the PULSIN command but there are a·couple limitations...First of all the maximum pulse width is about 131 ms.· Second, when the pulse width is at 0 or 100% the PULSIN command will read 0.· Also you'll have to scale your results, since the resolution is 2 us increments.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Tronic (Greece)
05-26-2006, 02:02 PM
Thanks, I already figured it out before reading your responce.

That article on Duty Cycle for More Reliable Accelerometer Measurements (http://forums.parallax.com/showthread.php?p=524815)·really helped me alot.


On the next video I demostrate the results of my ongoing mini project:


http://www.youtube.com/watch?v=WREPqBJaVyI


Regards, Thanos


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Greekbotics: Greek Robotics Forum (http://Greekbotics.knows.it)