@ 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
Bookmarks