IR-RS232 with pic 16F628A
Hi,
I am new in the forum and want to create some proyect but I need some help.
I am going to design a universal bidirectional interface IR-RS232 with the PIC and extra hardware.
The function of the pic is to translate IR codes to 232 and viceversa.
I´m planning to use a MAX232 to turn from -12 V and 12 V to TTL logic.
How can I program the pic in order to contemplate all carry frecuences, not only one, it may work on the range of 33KHz - 45KHz approximately.
Also if anyone has code examples, can you send it to me?
Thanks a lot!!
[email protected]
A simple IR Tx/Rx or IrDA
Hi there,
Please clarify if you intend to use the IR as medium of Transmission only or intending a full blown IrDA interface for your PIC. Microchip makes a chip that has the IrDA stack built into it. I don't recall the number but will post later.
If you intednd only a simple communication then select a PIC that has an onboard PWM generator (for theTx part anded with the serial data and thrown to an IR LED)and use a TSOP1736 or similar IR sensor-decoder to interface as the receiver.
Regards
Sougata
Get the datasheet for TSOP1736
Hi there,
The mentioned sensor is a three pin IR sensor/demodulator. It receives a modulated stream of 38/36 KHz IR and gives the output via its pulled up open collector port. So the output for a valid 1 is 0 that is inverted. It works best when the duty cycle for the carrier (38KHz nominal depends on the last two digits of the sensor part no.).
Take an AND gate. Feed 1 input with the 38KHz output from your PWM module. You can set up your PWM module in the PIC by the PBP HPWM command. Now feed the data (non-inverted) to the other input of the AND gate. Amplify (a higher current is needed for effective IR transmission over the ranage of 5 to 10 meters) the output of the AND gate and drive some IR LED. That goes for the Tx part.
For the Rx part , just invert the output from the sensor and feed it to the PIC.
for the software you can use the Serial Out and Serial In of PBP. A maximum possible speed is 2400bps.
Regards
Sougata