How can I measure Duty cycle ?


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    which is why I said to use the pulsin commands in the earlier post.
    I'm afraid this does not work; after the first pulsin has taken its reading, since the transition has *already* happenned, the next pulsin of the opposite polarity (level?) will take place only at the next-to-next pulse. Of course, if the duty cycle for a sequence is going to stay somewhat the same then this should make no difference. I was trying to decode an IR signal by using these consecutive pulsins, and got completelty wrong results.

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default PORTB Interrupt ?

    Hi,

    I am not sure about the fuel injection stuff. Possibly a variable duty and variable frequency. One option may be to use the portb on change interrupt feature. So for every falling or rising edge you get an interrupt. One problem is that depending on the timer prescaler you may run out of time if the frequency is too low causing a timer overflow. Again that can be accounted with ISR checking for timer overflow and incrementing a pseudo timer high byte counter making the timer a 16bit one.
    Regards

    Sougata

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking % of what ????

    Hi,Sougata,

    you're right ...

    But the big problem is injectors are nor open 100% of the cycle !!!

    a "100%" aperture equals, say, only 20 or 30 degrees at crankshaft ....

    and this value has to be entered somewhere to measure something useful.

    now, a simple "PULSIN" is enough to measure the ON duration in µs ... but maximal aperture ( vs. rotation speed ? ) has to be known to calculate a displayable percentage.

    add to that needles inertia is not negligible at those timings ... and you'll see your measure is somewhat false !!!

    Some data is missing here ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Replies: 9
    Last Post: - 8th October 2008, 12:15
  2. how to generate 83.33khz with 16.7% duty cycle?
    By donatelo in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd September 2008, 18:08
  3. HPWM the old fashioned way
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 19th November 2004, 20:09
  4. PWM _ Duty Cycle in Tenths
    By rwskinner in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 17th May 2004, 13:09
  5. Duty Cycle Dilemmas
    By crankshaft in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th February 2003, 13:40

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts