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 "waiting state" 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
Bookmarks