2
\$\begingroup\$

I have an android based embedded system, and I would like to command ir controlled devices, such as tv, air conditioner, sound system...etc. I need both rx and tx.

When I see examples on internet, most of them use lirc over gpio.

However, when I see most mobile phones with IR function, they use an IR encoder-decoder IC with an IR transceiver.

Why don't smartphones use gpio directly to control IR ?

\$\endgroup\$

3 Answers 3

2
\$\begingroup\$

"IrDA" is a somewhat more rigidly defined standard than "RC", including: (a) IR intensity / sensitivity vs. distance & speed (b) limiting IR pulses to a maximum length (regardless of what the device driving the IRED might try to do, deliberately or inadvertently) & (c) a 3/16ths encoding scheme, which an intermediary 'Endec' chip (e.g. MCP2120) or an endec module within a UART within a microcontroller (e.g. MSP430F5510) will do for you.

This is most easily achieved with an 'all in 1' module (without the endec) like this, for example:

http://rohmfs.rohm.com/en/products/databook/datasheet/opto/irda_module/rpm841-h16.pdf

Meeting all these specs in bit-banged GPIO when your CPU likely has better things to do is painful. Using a UART, optionally an intermediary Endec chip, and an integrated IrDA module makes implementation much easier. "RC" is different, less stringent.

\$\endgroup\$
2
  • \$\begingroup\$ Thank you soo much for your answer. RPM841-H16 is also an interesting solution. What do you think about such solution: mikroe.com/click/irda2 \$\endgroup\$ Commented May 1, 2015 at 18:02
  • \$\begingroup\$ That will do nicely :) \$\endgroup\$ Commented May 1, 2015 at 21:36
1
\$\begingroup\$

I think the reason is, that a specific hardware is always faster or even more reliable than the piece of software replacing the hardware. A nice example is the RAID system in computers. Two hard drives can be used as a RAID system when they are controlled by a RAID software. However, a real hardware RAID controller is much faster and therefore better, but more expensive.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ A point to be aware of which may or may not be relevant is that IR RXs that want goo range.bandwidth need low noise front end amplifiers and significant shielding and amplification tend to be employed. It may be that buying such ready made is more cost effective. \$\endgroup\$
    – Russell McMahon
    Commented Apr 28, 2015 at 7:13
0
\$\begingroup\$

Thank you everyone for their answers. My CPU is a 1.2Ghz dual core SoC. When I try ON-OFF toggling a GPIO with an infinite loop in C program, and looking at the result in oscilloscope, I can't get faster than 100uS... May be it need a kernel module to make it faster. It seems this is one of the reasons that manufacturers use a specific hardware for this purpose ?

\$\endgroup\$
1
  • \$\begingroup\$ Precisely :). at 1.2GHz I'm guessing your SoC is running Linux or some other general purpose OS, which is fine for most things, but not appropriate for things that require strict timing, especially not possible when you also try to bit-bang a tight protocol (like IrDA, WS2812 RGB LEDs, etc.), the interrupts and other processes going on elsewhere in the OS ruin your day for apps like that. \$\endgroup\$ Commented May 1, 2015 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.