IR-RS232 with pic 16F628A


Closed Thread
Results 1 to 12 of 12
  1. #1
    aloncha's Avatar
    aloncha Guest

    Default 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]

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default 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

  3. #3


    Did you find this post helpful? Yes | No

    Default IR communication


  4. #4
    aloncha's Avatar
    aloncha Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks to both of you!
    I only want to make a simple communication and PIC 16F628A has on board PWM, but I don´t know how it works.
    Can you help me?

  5. #5
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default 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

  6. #6
    jj 2's Avatar
    jj 2 Guest


    Did you find this post helpful? Yes | No

    Default

    I too am new to this forum. There are a lot of questions to be clarified.

    I assume the IR device output is TTL, 0-5 volts, 0 with no IR input and 5V with IR input. If so, why the Max232? Is the purpose of the Max 232 to provide output to go to a PC?

    I assume the device will output a sequence of ON/OFF TTL transitions similar to an RS-232 character - correct? Does the IR device output a RS-232 code? If not, then you need to decode the output some way. Assuming it is "RS-232 like" you will need to determine the bit timing and program the pic to detect the bit sequence.

    What is the data bit rate? I took a class once and we did some 1200 baud pic to PC RS-232 experiments using a 4MHz frequency for the pic. If the baud rate is faster you may need to go to a higher pic oscillator frequency.

    Google the Microchip web site and check out some of the application notes and sample code to get help on programming the pic to handle RS-232. Decoding another format code can be handled similarly.

    Hope this helps.

    jj 2

  7. #7
    aloncha's Avatar
    aloncha Guest


    Did you find this post helpful? Yes | No

    Default

    Sougata,

    Could you make some code examples in assembler about the Tx and help me?
    Thanks a lot!
    Alan

  8. #8
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Hold on a second, this has already been done.

    I built one myself a few years ago and it worked great.

    http://www.fukushima.us/UIRT2/

    I have since upgraded to the newest usb version.

    http://www.usbuirt.com/

  9. #9
    aloncha's Avatar
    aloncha Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks!
    But I want to create my own, so can you send me some code examples in assembly languaje, not an hex file???
    Again, thanks!

  10. #10
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    I can't send you anything, its not my code. You could contact the author and see if he is willing to send it to you.

  11. #11
    aloncha's Avatar
    aloncha Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for your help!
    The purpose of the MAX232 is to provide output to go to a pc and input from the pc.
    I want to send some string by RS-232 and output a IR signal, so I want to use the PIC as a translator.
    I want to save in PIC the IR code of the equipment and make correspond some string to an IR code, example: typing "PL" on the hyperterminal I want the pic to send de PLAY IR code, previously known.
    I´m planning to use the 4MHz oscilator, so what is the maximum speed allowed for that crystal?
    If you have some code examples you will help me a lot!!
    Thanks

  12. #12
    aloncha's Avatar
    aloncha Guest


    Did you find this post helpful? Yes | No

    Default

    Ok, can you send me his E-mail?

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 03:17
  2. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 11:00
  3. Sending Commands from Visual Basic about IR to Pic
    By tne_de in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th April 2009, 07:09
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 22:01
  5. PIC to RS232 interface
    By thon in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th February 2004, 03:01

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts