Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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

Status
Not open for further replies.
An interupt pin set to rising edge, unless you have a problem with noise.
 
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:
Mike said:
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.

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.

Latest threads

Back
Top