pulsin is not getting the next part of wave


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,171


    Did you find this post helpful? Yes | No

    Default Re: pulsin is not getting the next part of wave

    With Pulsin the short answer is no.

    Using the Timer 1 Gate will be much more easier ifyour PIC supports it.

    Also controlling the Interrupt Edge on PB0 in combination with a timer (0 or 1) will also help you on this.

    The edge is set in the Option Register, bit 6 on most PICs.

    Ioannis

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: pulsin is not getting the next part of wave

    Did you try the snippet I posted in the first reply? I think it's pretty straight forward and I think it's pretty much the way that pulsin works "behind the scenes" except that doing this way "trigs" on level and not on transition.

    If it doesn't work for whatever reason there are several other ways, some of which other members have outlined here but in order to be able to give you a good advice things like which chip you're using and at what frequency you're running it would be good to know. Not to mention what kind of resolution you actually NEED.

    /Henrik.

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


    Did you find this post helpful? Yes | No

    Default Re: pulsin is not getting the next part of wave

    Hi,

    Solution is pretty simple:

    Code:
    
    leader  var word
    leader1 var word
    
    Main:    
    PULSIN GPIO.0,0,Leader  ' leader pulse is ~9mS low-going on port 0
       
    IF Leader < 850  tHEN  main
      
    RCTIME GPIO.0,1,Leader1      ' check for 1stkey seq only no repeat headers
        
    if leader1 < 300 then Main  ' if high for < 300 (2.4ms then its the 2nkey)
    may be you could consider the IF condition takes few µs ... to be verified, because your time unit is 10µs !

    That's all !

    Alain
    Last edited by Acetronics2; - 30th March 2012 at 17:55.
    ************************************************** ***********************
    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 " !!!
    *****************************************

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