IR detector which port? RB0 (int), CCP1 or generic PIC pin?

Status
Not open for further replies.
Good question. And one I've been comtemplating recently.

If you want to decode Sony SIRC 12, 15, and 20 bit codes and you use the CCP "capture" mode timers then how would you know if you're decoding a 12, 15 or 20 bit code? In other words, how would you know when to stop waiting for a new edge interrupt?

It almost seems better to use CCP "compare" interrupts at computed intervals to sample and filter the 2400/550 "start" bit, the 550/550 "0" bit, or the 1100/550 "1" bit and simply clock in 20 bits, though the last several bits may be null for 12 and 15 bit codes.

Is there a better way to come up with a small simple reliable interrupt driven background decoder task?
 
That's got to be one of the most exotic uses for PWM I've come across (grin). I've used a resistor in series with a relay to accomplish something similar. When you first key the relay it sees the full voltage and as the current ramps up there's a small voltage drop built up across the resistor. Of course this wastes power on the resistor while your scheme is conserving energy quite nicely.
 
Last edited:

If you place an electroytic capacitor across the resistor the charging current will provide a full voltage pulse to the relay, then after it's charged the resistor will provide the holding current - fairly standard practice!.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…