??? 06/07/06 01:57 Read: times |
#117911 - What I would do Responding to: ???'s previous message |
Usually I write code that measures the high and low pulse widths of the incoming signal. I would use the timer capture hardware if my part has it. Then to decode these high and low times, you need to understand the protocol 'rules' and classify these pulsewidths as such - the protocol might have low short, high short, low long and high long as possible pulses. To classify the incoming pulse widths you need to determine if the pulsewidth is a long or a short pulse by doing a 'window comparison' that is checking the value is between an upper and lower boundary. This gives you tolerance to errors as the received pulsewidths can get distored on their path to your receiver. Once you have classified the pulsewidths you can feed these values into a finite state machine to decode the protocol. RC5 works well this way.
There's normally only a handful of popular protocols - do a web search to see which one yours is. |
Topic | Author | Date |
Receiving IR remote control code | 01/01/70 00:00 | |
What I would do | 01/01/70 00:00 | |
not the protocol | 01/01/70 00:00 | |
Not clearing IE0 | 01/01/70 00:00 | |
IE0 | 01/01/70 00:00 | |
IE0 does not need EX0 enabled | 01/01/70 00:00 | |
band-aids | 01/01/70 00:00 | |
timer in capture mode | 01/01/70 00:00 | |
"Long" pulses? | 01/01/70 00:00 | |
never use before![]() | 01/01/70 00:00 | |
how to prevent IE0 set | 01/01/70 00:00 |