RC5 code for infrared receiver


Results 1 to 24 of 24

Threaded View

  1. #9


    Did you find this post helpful? Yes | No

    Default I think I got it now !!

    @ Dave Houston and @ Bruce

    Hi Guys

    I think I finally got it !!

    I decided to measure the incoming pulses with PULSIN and debug :-), next step is a scope :-)

    So for the PULSIN command
    @ 4 Mhz PULSIN returns a value with a 10uS resolution/increments.
    So for the SONY protocol header the returned PULSIN value should be around 240 not so ?

    So if testing a SONY remote I should be testing for an incoming PULSIN value of between say 190 and 290 not so ?
    Those figures are based on the debug tests I have done with ..get this..a Phillips remote.

    One question here:
    What tolerance value should I be using ? Is 20% ok or should I use 30% just to be safe ?

    So i figure the header test would be something like

    Code:
    IRpulse_length var word(13)
    IRpin var GPIO.0
    
    getheader:
    
    PULSIN IRpin,0,IRpulse_length(0)
    
    if IRpulse_length <190 then getheader
    
    if IRpulse_length >290 then getheader
    
    goto getheader
    If the IR pulse passes the test , the next step is to collect the bits and then to possibly use an AND to mask the received data to split into device and commands .. not so ?

    Another question :
    How do I test the second pulse as in the case for the RC5 protocol ?
    Should I just grab all 13 bits following the initial header and then check the second bit once I have captured them all ?
    This would probably be the best idea since the second bit determines whether or not the code is RC5-X which only uses one start pulse.


    I would really appreciate your comments here. it's not a problem if you don't/can't reply since I'm sure you have been asked this a million times on these forums. I will still continue to experiment until I have it working though and will post back results along the way as always.

    Kind regards
    Dennis
    Last edited by Dennis; - 1st March 2010 at 21:16.

Similar Threads

  1. PBP code to read R/C signal from receiver
    By malc-c in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 28th October 2009, 21:51
  2. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  4. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  5. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26

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