Problems whith pulsin


Results 1 to 4 of 4

Threaded View

  1. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    there's probably many method. but did you tried with a sampling time of 10ms with a range of 68 to 82?

    Where the pulses cme from? did you monitor it to see if they're clean with the right amplitude?

    Before thinking of using internal counter or interupt, can you try the following and post your result?
    Code:
    ' Pic 16f84 at xtal 4 Mhz. WDT off PTU off' 
    ' Detecting 7.5Khz with +/- 10% => from 6.82 KHZ to 8.25 Khz
    ' measuring the frequency period =>147uSec to 121uSec
    '
    FI      VAR PORTA.3 'input freq
    SO      VAR PORTB.0 'OUPUT LED
    W0      VAR byte
    TLow    var byte
    THigh   var byte
    
    INIT:
        pulsin fi,0,Tlow
        pulsin fi,1,Thigh
        w0=tlow+thigh
        IF (W0<15) AND  (w0>12) then PULSE
        GOTO INIT
    
    PULSE:
        HIGH SO 
        PAUSE 500
        LOW SO
        PAUSE 500
        GOTO INIT
    END
    make sense to me ... after being more than 24 hours awake...
    Last edited by mister_e; - 14th September 2005 at 02:28.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. Better understanding PULSIN
    By Wirecut in forum mel PIC BASIC
    Replies: 12
    Last Post: - 29th June 2008, 10:17
  3. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 08:02
  4. Pulsin 16F819 problem
    By rekcahlaer in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th April 2007, 13:52
  5. PULSIN and RCTIME
    By Dwayne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th November 2004, 14:45

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