Recording incoming logic signal duration, both edges - how to?


Results 1 to 7 of 7

Threaded View

  1. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    946


    Did you find this post helpful? Yes | No

    Default

    Hi Dave,

    I'm recording all kind of remotes like ones for TVs as well as garage-door openers, electric-shades and so on. My remote is ment to be really "universal", well at least I dream it will be so.

    As where most TV protocols work fine with my code, the other ones don't use "standard" protocols and that's the reason why I have to record both signal's state durations with, appearently, a little more precision.

    This is the "learning sequence" of the code I currently work on:
    Code:
    <html><head></head><body><!--StartFragment--><pre><code><font color="#000000">LEARN:
    <b>PULSIN </b>IRM_Out, 0, l_Bit[0]        <font color="#000080"><i>'get the first Low pulse
    </i></font><b>TOGGLE </b>C_Led                       <font color="#000080"><i>'indicate the &quot;waiting state&quot; to user
    </i></font><b>IF </b>l_Bit[0] = 0 <b>THEN </b>LEARN:        <font color="#000080"><i>'wait for the first pulse to start recording
    </i></font>C_Led = 1                          <font color="#000080"><i>'led is ON, learn has started
    </i></font><b>RCTIME </b>IRM_Out, 1, h_Bit[0]        <font color="#000080"><i>'get first High pulse from IR Module
    </i></font><b>FOR </b>Ctr_A = 1 <b>TO </b>(Max_Bit - 1)
       <b>RCTIME </b>IRM_Out, 0, l_Bit[Ctr_A] <font color="#000080"><i>'get Low pulse (1 to 38) from IR Module
       </i></font><b>RCTIME </b>IRM_Out, 1, h_Bit[Ctr_A] <font color="#000080"><i>'get High pulse (1 to 38) from IR Module
    </i></font><b>NEXT </b>Ctr_A
    <b>RCTIME </b>IRM_Out, 0, l_bit[Max_Bit]  <font color="#000080"><i>'get last Low pulse from IR Module
    </i></font><b>RCTIME </b>IRM_Out, 1, H_bit[Max_Bit]  <font color="#000080"><i>'get last High pulse from IR Module
    </i></font>C_Led = 0
    <b>END</b></code></pre><!--EndFragment--></body></html>
    Full code is in attached ZIP file.

    I'll try to adapt your code to my usage and see what I get. Thanks a lot for that.

    Bruce,

    I have only some 10F, 12F and 16F in my drawer

    Nevertheless, I'm going to grab the datasheet of this particular PIC and see what this function does. Something new to learn
    Attached Files Attached Files
    Roger

Similar Threads

  1. Replies: 24
    Last Post: - 1st December 2009, 09:01
  2. Decoding an incoming infrared signal: need advice
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 9th May 2008, 17:28
  3. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 15:19
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 21:36

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